From: "Zed A. Shaw" Date: 2006-09-25T05:05:44+09:00 Subject: Re: Array shift bug 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). -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.