From: Daniel Berger Date: 2006-09-25T07:40:09+09:00 Subject: Re: Array shift bug Zed A. Shaw wrote: > On Mon, 25 Sep 2006 01:09:10 +0900 > "Eric Mahurin" wrote: > > > On 9/24/06, Nobuyoshi Nakada wrote: > > > > > > Hi, > > > > > > At Sun, 24 Sep 2006 11:52:27 +0900, > > > Devin Mullins wrote in [ruby-talk:216068]: > > > > > > > > Bob Hutchison wrote: > > > > > A short article describing a problem in the implementation of array > > > > > shift in Ruby 1.8.4 with a simple one-line fix in the C code is here: > > > > That's half a fix. If you're using shift and push to manage a queue, you > > > > still have an ever-growing buffer.* > > > > > > Does this patch fix it? > > > > > This was one of the issues I was addressing in a patch I made a year ago: > > > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/5861 > > > > In addition to this memory issue with element sharing, I also made > > performance for operating at either end of the array symmetrical (i.e. > > shift/unshift same performance as pop/push). From my testing of perl, it > > has this now. > > A *year* ago? A whole year? You mean, I've been having this problem, people have denied it was a problem, they've insulted me, they've told me I'm full of it for a full on month, called me a liar, large production operations have been crashing over it, countless hours were wasted trying to fix it... > > and someone posted a patch over a year ago to fix it that nobody bothered to apply? > > Not only that but Eric improved the performance *and* had a test case that demonstrated the performance enhancement *and* Perl has these changes? > > Please, someone tell me it slipped through the cracks or that Eric is wrong (doesn't look like it). I could be wrong but I'm pretty sure the patch was against 1.9 only. Although, it probably could have been backported. ruby-core: 5861 and 5869 Regards, Dan PS - We love you Zed!