3 ms·
Nice to see the different implementations side-by-side. I do believe however that this is mainly a benchmark of startup time and initial JIT of the CRT/runtime/
by sebazzz 8y ago
Nice to see the different implementations side-by-side. I do believe however that this is mainly a benchmark of startup time and initial JIT of the CRT/runtime/virtual machine/execution environment.
If you remove that time from the equation, I expect that the execution time will not differ a lot from each other.
- comboy 8y agoStartup time of most VMs is in miliseconds. For VM stuff that includes compilation all times are 10s+.
- chvid 8y agoOf all the benchmarks out there this is actually reasonable (though obviously limited). It runs the same thing in different languages and the processing time is long enough for VM startup not to matter. Also the performance shows the bytecode languages C# and Java to do fairly well compared to C and GO.
- thecatspaw 8y agoJava needs warmup time though to optimize, and the configuration of the vm can have a heavy inpact on performance as well
- imtringued 8y agoThat has mostly to do with the fact that the code isn't manipulating objects at all. As soon as you're starting pointer chasing in languages where almost everything is an object like javascript performance will suffer.
- FabHK 8y agoI thought so as well, and benchmarked the Julia version inside the REPL (after calling the function once to make sure JIT compilation was done), and the difference was insignificant (maybe 1 to 5 percent - basically same order of magnitude as the measurement error, ie usual run time fluctuations). So Julia runtime was still a bit less than 2x the C/C++ runtime (but faster than C/C++ without the -O3 switch).
- ChrisRackauckas 8y agoThis shouldn't be surprising though. The point of Julia is that compilation time stays relatively constant while runtimes can grow enormous very easily. Normally with microbenchmarks you run multiple times to get rid of compilation time because microbenchmarks run in <1 second so compile time matters. But this show that, in any case where the user does begin to care about speed, that compilation time is really minimal. The only place where it truly matters in practice is in the REPL: it can cause a bit of lag which can get annoying but it's a tradeoff.