On Monday 27 Dec 2010 23:30:24 C.DeRykus wrote: > On Dec 25, 2:21 am, shlo...@iglu.org.il (Shlomi Fish) wrote: > > ---------- Forwarded Message ---------- > > > > Subject: Re: Writing 3D games with Perl... How's the Performance? > > Date: Friday 24 December 2010, 12:43:11 > > From: Shlomi Fish <shlo...@iglu.org.il> > > To: beginn...@perl.org > > CC: "U.N." <blahbleh...@hotmail.com> > > > > [snip] > > > > > I realize that comparing Java and Perl is like comparing Apples and > > > Oranges, but since they are both interpreted I would guess that they > > > both share a similar performance handicap. > > > > Jave is also not interpreted. Like Perl it is compiled to bytecode, but > > unlike Perl, this bytecode can be executed directly from the disk (e.g: > > its .class files), and, furthermore, many Java implementation contain an > > additional optimisation step called Just-in-time compilation (JIT): > > > > http://en.wikipedia.org/wiki/Just-in-time_compilation > > > > This improves the performance considerably, and as a result, Java code > > tends to run much faster than the equivalent Perl one. (Though many > > people feel Java has other performance issues such as being "sluggish", > > where Perl fares better.). > > I don't doubt that Java - especially with JIT - can be > faster than Perl for some tasks... but "much faster"...? > Do you have a citation?
Well, it depends what you (or I) mean by "much faster" vs. faster. Is a 2x speed improvement "much faster"? How about 1.5x? I didn't benchmark a Java program vs. a Perl program but after porting my Black Hole Solitaire solver from Perl 5 to C, the C version ran roughly 24 times faster: http://tech.groups.yahoo.com/group/hackers-il/message/5133 If we assume that Java runs 3 times as slow as C, it would mean the Java version would run 8 times as fast as Perl which is "much faster" in my book[optimisations]. And some people I talked with claimed that Java already ran "as fast as C". > > And I seem to recall Perl being faster than Java in many > areas, particularly, if there's heavy text processing and > performing equivalently if there's lots of I/O. Perhaps > that's no longer the case (or maybe bias has warped my > memory). That may be the case. I was referring to CPU-bound applications when saying that a JIT-based Java backend would execute the code "much faster" than Perl. > > -- > Charles DeRykus [optimisations] - when recently optimising http://fc-solve.berlios.de/ , I performed many small optimisations that sometimes saved a second at a time or so, and which put together made it over 3 times faster. So I don't consider such optimisations to be too neglible to apply. -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Stop Using MSIE - http://www.shlomifish.org/no-ie/ Chuck Norris can make the statement "This statement is false" a true one. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/