News for hackers. Stuff that matters.
Re:A comparison of programming languages in economics by Alupis on Wednesday July 02, 2014 @09:14PM (#7980908)
> EDIT: I stand corrected. I downloaded his examples off Github and ran them the same way as the paper. I get 1.87s for C, and for Java... also exactly 1.87s.

Your code probably got JIT'ed... which essentially makes your java code into native C... So... it's no surprise they perform around or exactly the same (given the JVM is allowed time to warm up, discover "hot spots", and then perform the JITing)

Re:A comparison of programming languages in economics by georgewfraser on Wednesday July 02, 2014 @09:18PM (#7980926)
True though oddly I compiled and ran them exactly the same way he described in the paper -- one time through, no warm-up time.
Re:A comparison of programming languages in economics by Terr_ on Wednesday July 02, 2014 @09:22PM (#7980941)
I think the command-line option -XX:+PrintCompilation should show you if/when the JIT kicks in for a method.
Re:A comparison of programming languages in economics by Alupis on Wednesday July 02, 2014 @09:30PM (#7980967)
The sample code is probably too predictable and the JVM was able to optimize it well.

In any event... the "myth" that Java is slow is bogus :)