JuliaLang / Microbenchmarks

Microbenchmarks comparing the Julia Programming language with other languages
https://julialang.org/benchmarks/
Other
88 stars 48 forks source link

Show "--" instead of "0.00" in the table for missing data points #8

Closed waldyrious closed 6 years ago

waldyrious commented 6 years ago

From this comment:

The -- in JavaScript's print_to_file is meant to indicate a missing value — JavaScript is sandboxed and can't print to a file, as far as I understand. The perl script as is generates 0.0 for this missing datapoint. I've been changing that to -- manually. IMHO it'd be nice if the table.pl did this automatically, but I don't think it's a big deal either way.

Enet4 commented 6 years ago

On the other hand, since the JavaScript benchmark seems to be running on top of Node.js, writing to a file is actually possible with the fs module. A synchronous version would look like this:

const fs = require('fs');
function printfd(n) {
  let f = fs.openSync("/dev/null", "w");
  for (let i = 1; i <= n; i++) {
    fs.writeSync(f, `${i} ${i + 1}\n`);
  }
  fs.closeSync(f);
}

Wouldn't it be preferable to have this data point? :)

johnfgibson commented 6 years ago

fixed by PR #12