/mobile Handheld Friendly website

 performance measurements

Each table row shows performance measurements for this Dart program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
250,000Failed  443   

Read the ↓ make, command line, and program output logs to see how this program was run.

Read reverse-complement benchmark to see what this program should do.

 notes

Dart VM version: 1.3.0 (Tue Apr 8 09:38:50 2014) on "linux_x64"

 reverse-complement Dart program source code

/* The Computer Language Benchmarks Game
   http://benchmarksgame.alioth.debian.org/

   Contributed by Thomas Sahlin
   Lookup table optimization by Alex Tatumizer
*/

import 'dart:io';

void main() {
  var src   = "CGATMKRYVBHD";
  var dst   = "GCTAKMYRBVDH";
  var tbl   = new List<int>(256);
  var seq   = new List<int>();
  
  // Set up lookup table
  
  for (int i = 0; i < tbl.length; i++)
    tbl[i] = i;
  
  for (int i = 0; i < src.length; i++) {
    tbl[src.codeUnitAt(i)]                = dst.codeUnitAt(i);
    tbl[src.toLowerCase().codeUnitAt(i)]  = dst.codeUnitAt(i);
  }
  
  // Function to print the sequences in reverse order
  
  void printSeq() {
    for (int i = seq.length - 60; i >= 0; i -= 60) {
      var line = seq.getRange(i, 60);
      
      print(new String.fromCharCodes(line.reversed.toList()));
    }

    if (seq.length % 60 > 0) {
      var line = seq.getRange(0, seq.length % 60);
      
      print(new String.fromCharCodes(line.reversed.toList()));
    }
  }
  
  // Start processing
  
  stdin
    .transform(new StringDecoder())
    .transform(new LineTransformer())
    .listen((String line) {
      if (line.startsWith(">")) {
        // Comment line - output the previous sequence and the comment
        
        printSeq();
        print(line);

        // Start a new sequence
        
        seq.clear();
      } else {
        // Translate characters and add them to the sequence
        
        for (int byte in line.codeUnits)
          seq.add(tbl[byte]);
      }
    }, onDone: () { printSeq(); });
}

 make, command-line, and program output logs

Thu, 17 Apr 2014 03:26:01 GMT

COMMAND LINE:
/usr/local/src/dart-sdk/bin/dart --old_gen_heap_size=2048 revcomp.dart 0 < revcomp-input250000.txt

PROGRAM FAILED 


PROGRAM OUTPUT:

Unhandled exception:
'file:///home/dunham/benchmarksgame_quadcore/revcomp/tmp/revcomp.dart': malformed type: line 45 pos 20: type 'StringDecoder' is not loaded
    .transform(new StringDecoder())
                   ^
type error.
#0      main (file:///home/dunham/benchmarksgame_quadcore/revcomp/tmp/revcomp.dart:45:20)
#1      _startIsolate.isolateStartHandler (dart:isolate-patch/isolate_patch.dart:216)
#2      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:115)

Revised BSD license

  Home   Conclusions   License   Play