6 ms·
Ruby is known as the slowest and memoryhungriest language in common use today, is there any reason why people should know how it achieves that? How does this ad
by jpr 17y ago
Ruby is known as the slowest and memoryhungriest language in common use today, is there any reason why people should know how it achieves that? How does this advance the state of the art?
- tmm1 17y ago"Now you know, and knowing is half the battle."
- FooBarWidget 17y agoUh what? Are you saying some like "X has problem Y, why should anybody study problem Y"? > and memoryhungriest language in common use today I think you've never heard of Perl.
- telemachos 17y agoI didn't realize that Perl was memory intensive compared with Ruby (or other comparable languages more generally). Any links for that? (Not trolling: I use both Perl and Ruby day to day, and I'm curious. I certainly haven't noticed significant differences in memory usage. Speed certainly - Perl being faster in many cases.)
- sreque 17y agohttp://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=yarv&lang2=perl http://shootout.alioth.debian.org/u32/benchmark.php?test=all.... With the exception of one benchmark ruby's memory is about the same as perl's. As for speed usage, ruby is no more than twice as slow as perl for most benchmarks. It does poorly on pidigits because there aren't gmp bindings available for ruby 1.9, and it does significantly worse on regex-dna because perl's regex library is much higher quality. Both are so much slower than C that a 2x difference is insignificant.
- FooBarWidget 17y agoBenchmarks don't say anything when it comes to real memory usage. In my experience Perl is a lot more memory hungry than Ruby. All the data structures take so much memory. Defining a single, empty function eats 1.5 KB (!) of memory. I had a Perl program of about 30k lines, and it ate 25 MB during startup, most of which is consumed just by storing the Perl optree. During runtime memory usage would jump to 35 MB as it loads all kinds of data into hash tables and stuff.