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

I noticed some differences in the code that I think are not equivalent

Perl: print $local_process_var, " ", &gen_pg_template(), "\n"

Python: print local_process_var, " ", gen_pg_template()

Java: System.out.println( timestamp + " " + genPgTemplate() );

I'm not sure, but I think the Perl/Python code sends the strings as arguments to print that will just output them directly. In Java you will concatenate 3 strings before sending it to "print". This adds some extra CPU usage that the other versions don't have



One item of possible note: It wasn't possible to have list driven output syntax in Java before 1.5. I'm not sure if they added an output method with elipses in it then, or not. Even if so, I'm not sure it would be faster.

Still, I could modify the scripting output lines to bring them down to Java's level :-)


Thanks for the observation. Not sure when I will get to revisiting this, but that seems like an easy inconsistency to clean up, and I probably should.




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

Search: