Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

these benchmarks also include the time it takes the vm to start up and may not include full JIT performance. locally in jruby pidigits.rb 2000 takes 4.132s, running it twice it takes 4.965s. jruby is quite annoying for running small little scripts because of the startup time but it an be quite nice for full applications.


>> jruby pidigits.rb 2000 takes 4.132s <<

Why did you measure a workload 1/5th of the workload shown on the benchmarks game webpages?

Each program page shows measurements for 3 workloads, in the case of pi-digits 2,000 6,000 and 10,000.

http://shootout.alioth.debian.org/u32/program.php?test=pidig...


Yes, each Ruby method needs to get executed 50 times to JIT to JVM bytecode, and from there it takes an additional 10,000 calls for HotSpot to JIT that to machine code.

Any hotspots therefore need to be hit at least 10,050 times in order to be fully warmed up.


Just start the JVM with -XX:CompileThreshold=<some_number>

It only defaults to 10,000 when the JVM is running in server mode, its 1,500 when in client. Which mode a default install runs in is a bit wonky so I always explicitly set it (with -server as an argument to the JVM).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: