Re: [code-review] Tie::Array::Sorted
Simon Cozens <simon-eH/[email protected]> Wed, 12 Nov 2003 17:21:38 +0000
| Newsgroups | gmane.comp.lang.perl.code-review-ladder |
|---|---|
| Message-ID | <[email protected]> |
Tony Bowden: > This implies there's probably some cut off point where if the user is > pushing more than X items on to the list at once, it's going to be > faster (potentially significantly faster) to just delegate it off to the > builtin sort, rather than repeatedly running your own binary search. > > I have no idea how to calculate that number however. It's conceivable that the cut-off is when the number of items added is >= the number of items already in the list. Someone else suggested it might be more efficient in some cases to sort the list on access rather than on store. > I also don't really think it's worth doing for the module - just > throwing it out as a random observation ... *nod*. There's no way to be both general purpose and maximally efficient, so I'm going to allow myself not to care. :) -- It is now pitch dark. If you proceed, you will likely fall into a pit.