9.9){ return number_format($d); }
elseif ($d>0.0){ return number_format($d,1); }
else { return " "; }
}
// PAGE ////////////////////////////////////////////////
MkMenuForm($Tests,$SelectedTest,$Langs,NULL);
$Row = $Tests[$SelectedTest];
$TestName = $Row[TEST_NAME];
$TestTag = $Row[TEST_TAG];
$TestLink = $Row[TEST_LINK];
list($Succeeded,$Failed,$Special,$Labels,$Ratios) = $Data;
unset($Data);
$first = 0;
$NString = 'N=?';
foreach($Succeeded as $d){
if ($d[DATA_TESTVALUE]>0){
$testValue = (double)$d[DATA_TESTVALUE];
$NString = 'N='.number_format($testValue);
break;
}
}
// BEWARE - Hard coded values - BEWARE
if ($TestName=='fasta'||$TestName=='k-nucleotide'||
$TestName=='reverse-complement'||$TestName=='regex-dna'){
if ($d[DATA_TESTVALUE] == 25000000) { $NString = '≈240MB '.$NString; }
elseif ($d[DATA_TESTVALUE] == 2500000) { $NString = '≈24MB '.$NString; }
elseif ($d[DATA_TESTVALUE] == 5000000) { $NString = '≈50MB '.$NString; }
elseif ($d[DATA_TESTVALUE] == 1000000) { $NString = '≈10MB '.$NString; }
elseif ($d[DATA_TESTVALUE] == 500000) { $NString = '≈5MB '.$NString; }
}
if ($TestName=='startup'){ $NString = ''; }
// Use the table column headers to emphasize the row sort order
$CPU_sort_td = '
sort | ';
$MEM_sort_td = '
sort | ';
$ELAPSED_sort_td = '
sort | ';
$GZBYTES_sort_td = '
sort | ';
if ($Sort=='fullcpu'){
$CPU_sort_td = '
| ';
$Chart_intro_1 = '
how many times slower';
$Chart_intro_2 = 'program was, compared to the fastest program';
} elseif ($Sort=='kb'){
$MEM_sort_td = '
| ';
$Chart_intro_1 = '
how many times more Memory';
$Chart_intro_2 = 'program used, compared to the program that used least Memory';
} elseif ($Sort=='elapsed'){
$ELAPSED_sort_td = '
| ';
$Chart_intro_1 = '
how many times slower';
$Chart_intro_2 = 'program was, compared to the fastest program';
} elseif ($Sort=='gz'){
$GZBYTES_sort_td = '
| ';
$Chart_intro_1 = '
how many times more Code';
$Chart_intro_2 = 'program used, compared to the program that used least Code';
}
if ($CanonicalPage){ echo '
'; }
?>
Each chart bar shows , one ↓ .

These are not the only programs that could be written. These are not the only compilers and interpreters. These are not the only programming languages.
Column × shows how many times more each program used compared to the benchmark program that used least.
ndiff program output N = 600 with this output file to check your program output has the correct format before contributing.
We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.
The text-part and spelled-out numbers in the program output should match the expected output exactly. Thread scheduling may cause small differences in the other numbers, so program output is checked with ndiff -fields 2-10
Each program should
- create differently coloured (blue, red, yellow), differently named, concurrent chameneos creatures
- each creature will repeatedly go to the meeting place and meet, or wait to meet, another chameneos "(at the request the
caller does not know whether another chameneos is already present or not, neither if there will be one in some future)"
- both creatures will change colour to complement the colour of the chameneos that they met - don't use arithmetic to complement the colour, use if-else or switch/case or pattern-match
- write all the colour changes for blue red and yellow creatures, using the colour complement function
- for rendezvouses with an odd number of creatures (blue red yellow) and with an even number of creatures (blue red yellow red yellow blue red yellow red blue)
- write the colours the creatures start with
- after N meetings have taken place, for each creature write the number of creatures met and spell out the number of times the creature met a creature with the same name (should be zero)
- spell out the sum of the number of creatures met (should be 2N)
The chameneos benchmark is an adaptation of "Chameneos, a Concurrency Game for Java, Ada and Others" 100KB pdf (which includes example implementations in Java, Ada and C).
Programs may use pre-emptive kernel threads or pre-emptive lightweight threads; but programs that use non pre-emptive threads (coroutines, cooperative threads) and any programs that use custom schedulers, will be listed as interesting alternative implementations. Briefly say what concurrency technique is used in the program header comment.