From: Hugh Sasse Date: 2006-11-07T02:54:48+09:00 Subject: Re: fast mutexes for 1.8? On Tue, 7 Nov 2006, MenTaLguY wrote: > On Mon, 2006-11-06 at 23:21 +0900, khaines@enigo.com wrote: > > So, what would you suggest as a performance optimization to Mutex? > > Principally, pushing the whole thing into C and using a better data > structure than a dynamically allocated C array of VALUEs (what underlies > Array) for the wait queue. > > That way, we can eliminate a whole slew of Ruby method calls and > variable lookups, as well as making all the important wait queue > operations O(1). That complexity thing will probably matter less than > it should, since wait queues aren't normally that long, but eliminating > all those method calls should be a big win. I wish Ruby came with a C coded Heap out of the box. Too late to add that to 1.8 now, I suppose? They are good for priority queues of course... Hugh