I just read an interesting article on Newsfactor.com. A student researcher made memory and time measurements for two different problems (text search and sieve of Eratosthenes) in four programming languages: C, Perl, Java, and Basic. Not surprisingly, the programs in C ran the fastest and used the least memory overall.
But I was surprised that in the relative rankings of the other languages, Perl was the second to most memory-efficient (in her terminology) for the text search problem, and most memory-efficient in the numeric problem, even beating out C. I had always believed the "common knowledge" that Perl used lots of memory, favoring memory use wherever it could gain in execution speed. The time efficiency numbers are not too shabby for Perl either, but the memory efficiency was a real surprise to me.
The article doesn't provide any code, and even the researcher admits she was not knowledgeable of programming when she started, so take the results with a grain of salt. Can anyone find the paper or code online? I couldn't (not lazily, anyway ;-) It was presented at this year's AAAS conference.
Given the recent inter-language flamage that's ocurred in the monastery, I want to add this clarification. My interest in the paper is not "My language wins, your language loses", but that a belief I'd held about Perl appears to be not borne out experimentally.
In reply to Efficiency comparisons by VSarkiss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |