News for hackers. Stuff that matters.
Re:Garbage Collection and the Ruby Heap by jpr on Monday February 22, 2010 @05:12PM (#1143889)
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?
Re:Garbage Collection and the Ruby Heap by tmm1 on Monday February 22, 2010 @05:28PM (#1143927)
"Now you know, and knowing is half the battle."
Re:Garbage Collection and the Ruby Heap by FooBarWidget on Monday February 22, 2010 @05:58PM (#1143997)
Uh 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.

Re:Garbage Collection and the Ruby Heap by telemachos on Monday February 22, 2010 @06:04PM (#1144010)
I 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.)

Re:Garbage Collection and the Ruby Heap by sreque on Tuesday February 23, 2010 @12:07AM (#1144740)
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.

Re:Garbage Collection and the Ruby Heap by FooBarWidget on Tuesday February 23, 2010 @05:29AM (#1145116)
Benchmarks 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.