JuliaLang / Microbenchmarks

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

convert Perl scripts to Julia #13

Closed StefanKarpinski closed 6 years ago

StefanKarpinski commented 6 years ago

@johnfgibson, can you try using these to regenerate the HTML tables and check that they work? Alternatively, if you can send me the latest set of CSVs, I can do it locally.

StefanKarpinski commented 6 years ago

Does that 👍 mean that you ran the scripts and they worked or that you will run them and report back?

johnfgibson commented 6 years ago

It meant "yes I'll do that", which I've just now completed. It's nearly fine, just a couple glitches (see below). I've posted the benchmark data at http://channelflow.org/benchmarks.tgz so you can diagnose the javascript version glitch locally. I'll see what I can do about Matlab version glitch.

bin/collect.jl works fine. The output is the same as from bin/collect.pl, except trailing zeros are truncated (an improvement).

bin/table.pl has trouble with the shell evaluation of version numbers for javascript. When make benchmarks.html evaluates javascript_ver(), it produces the error.

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `nodejs -e console.log(process.versions.v8) 2>&1'
ERROR: LoadError: failed process: Process(`sh -c 'nodejs -e console.log(process.versions.v8) 2>&1'`, ProcessExited(1)) [1]

If I replace that function with a stub and continue, I get some intermittent errors with the matlab version evaluation. Matlab occasionally segfaults on matlab -nodisplay -nojvm -nosplash -r 'version -release, quit', producing this error from make benchmarks.html.

sh: line 1: 19504 Killed                  matlab -nodisplay -nojvm -nosplash -r 'version -release, quit' 2>&1
ERROR: LoadError: failed process: Process(`sh -c "matlab -nodisplay -nojvm -nosplash -r 'version -release, quit' 2>&1"`, ProcessExited(137)) [137]

This has been occurring for some time under table.pl, but it is much more frequent when called from table.jl, and much rarer when I run the same from the command line. Doesn't make a lot of sense. I'm running a preview version of Matlab R2018a; will upgrade that and hope the problem goes away.

With stubs for both javascript_ver() and matlab_ver(), make benchmarks.html runs to completion and produces the same HTML output as table.pl up to whitespace.

StefanKarpinski commented 6 years ago

Ok, I'm changing approaches for the version stuff. It seems like it's easier to just write a shell script that outputs the version info as CSV data. Can you run this script and send me the output (if it works):

#!/usr/bin/env bash

echo -n "c,gcc "
gcc -v 2>&1 | grep "gcc version" | cut -f3 -d" "

echo -n "fortran,gcc "
gfortran -v 2>&1 | grep "gcc version" | cut -f3 -d" "

echo -n go,
go version | cut -f3 -d" "

echo -n java,
java -version 2>&1 |grep "version" | cut -f3 -d " " | cut -c 2-9

echo -n "javascript,V8 "
nodejs -e "console.log(process.versions.v8)"

echo -n "julia,"
$JULIAHOME/usr/bin/julia -v | cut -f3 -d" "

echo -n "lua,"
# scilua -v 2>&1 | grep Shell | cut -f3 -d" " | cut -f1 -d,
echo scilua v1.0.0-b12

echo -n "mathematica,"
echo quit | math -version | head -n 1 | cut -f2 -d" "

echo -n "matlab,R"
matlab -nodisplay -nojvm -nosplash -r "version -release, quit" | tail -n3 | head -n1

echo -n "octave,"
octave -v | grep version | cut -f4 -d" "

echo -n "python,"
python3 -V 2>&1 | cut -f2 -d" "

echo -n "r,"
R --version | grep "R version" | cut -f3 -d" "

echo -n "rust,"
(cd rust; rustc --version | cut -c 7- | sed 's/ ([0-9a-f]* /<br>(/g')
StefanKarpinski commented 6 years ago

I've moved generating the version strings into its own shell script (same as the above but now included in the PR) which allows sending someone versions.csv and benchmarks.csv and generating benchmarks.html in pure Julia just from those. Hopefully this works for you now @johnfgibson, and if not, you can send me those files and I can debug it.

johnfgibson commented 6 years ago

Great, thanks. I will run and check this in the morning.

johnfgibson commented 6 years ago

The versions.sh code works fine, and I like the decoupling of the text processing from the build environment. versions.csv is

c,gcc 4.8.5
fortran,gcc 4.8.5
go,go1.9
java,1.8.0_16
javascript,V8 4.5.103.53
julia,0.7.0-DEV
lua,scilua v1.0.0-b12
mathematica,11.1.1
matlab,R    '2018a'
octave,4.0.3
python,3.6.3
r,3.3.1
rust,1.27.0-nightly<br>(2018-04-15)

The output for Matlab can be cleaned up a little with cut & sed

matlab -nodisplay -nojvm -nosplash -r "version -release, quit" | tail -n3 | head -n1 | cut -f5 -d" " | sed "s/'//g"

gives matlab,R2018a

johnfgibson commented 6 years ago

This is good to merge, I believe. I've checked the html and csv output in my local copy of julialang.github.com; they're fine.