3 ms·
In the matrix multiplication example, the measurement is done via a simple t = time() results = calc(n) elapsed = time() - t So startup time at le
by cygx 6y ago
In the matrix multiplication example, the measurement is done via a simple
t = time()
results = calc(n)
elapsed = time() - t
So startup time at least isn't included.
One might argue that this is still biased against Julia due to its compilation strategy, but fixing that would mean you'd have to figure out what the appropriate way to get 'equivalent' timings for any of the other languages would be as well - something far more involved than just slapping a timer around a block of code in all cases...
edit: As pointed out below, the Julia code should indeed already have been 'warmed up' due to a preceding sanity check. My apologies for 'lying'...
- komuher 6y agoIf u cant even read code dont lie xD n = length(ARGS) > 0 ? parse(Int, ARGS[1]) : 100 left = calc(101) # <------- THIS IS COLD START JITTING CALL right = -18.67 if abs(left - right) > 0.1 println(stderr, "$(left) != $(right)") exit(1) end notify("Julia (no BLAS)\t$(getpid())") t = time() results = calc(n) elapsed = time() - t notify("stop")
- 3JPLW 6y agoThe problem is a minor placement issue for the `@simd` macro: https://github.com/kostya/benchmarks/pull/317 https://github.com/kostya/benchmarks/pull/317