Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Perl, Java, and mallocby cyocum (Curate) |
on Oct 09, 2005 at 13:41 UTC ( [id://498560]=perlquestion: print w/replies, xml ) | Need Help?? |
cyocum has asked for the wisdom of the Perl Monks concerning the following question: Greetings Fellow Monks I was reading an article, which was linked from Slashdot. It is about the oft repeated myth of the slowness of memory allocation and deallocation in the JVM. What really caught my eye was this statement by the author of the article: "And allocation performance is not a trivial component of overall performance -- benchmarks show that many real-world C and C++ programs, such as Perl and Ghostscript, spend 20 to 30 percent of their total execution time in malloc and free -- far more than the allocation and garbage collection overhead of a healthy Java application" Now the author links to a research article on the subject here (warning: it is a PDF file). A quick browse through the article shows that it was done using Perl 4.10: "Perl C Perl 4.10, is a publicly available report extraction and printing language commonly used on UNIX systems. The input script formatted the words in a dictionary into filled paragraphs." Now, as far as I understand the situation, Java and Perl share the same idea of VM and Garbage Collection. So, I guess my question is: is this still true using the newest versions of Perl and if it is, what differences in the implementation of Perl make it so much slower than Java at allocating memory (the author claims 10 machine instructions while malloc is 60-100)?
Back to
Seekers of Perl Wisdom
|
|