From: Eric Mahurin Date: 2007-09-03T16:11:18+09:00 Subject: Re: [QUIZ] Twisting a Rope (#137) On 9/3/07, Eric Mahurin wrote: > On 8/31/07, Ruby Quiz wrote: > > This week's task is to implement the Rope data structure as a Ruby class. > > My implementation is attached along with a modified test. I made a > few changes to what was asked, but this also gave more flexibility. Forgot about the results. Here's what I found on my machine: String Build: 0.120000 0.080000 0.200000 ( 0.206264) Sort: 1.680000 0.420000 2.100000 ( 2.112934) VmPeak: 1192112 kB VmSize: 493708 kB StringRope Build: 0.010000 0.000000 0.010000 ( 0.014414) Sort: 0.150000 0.020000 0.170000 ( 0.176734) VmPeak: 38940 kB VmSize: 37920 kB so, 20X faster for build and 12.4X faster for sort. Memory looks to be 10-30X smaller. I ran the build and sort 8 times during the benchmark and took the min. The memory kept increasing for the String runs for each of these 8 iterations which doesn't make sense.