>>>>> "SHC" == Shawn H Corey <shawnhco...@gmail.com> writes:

  SHC> Jenda Krynicky wrote:
  >> ST is an overkill if the extraction is simple. 
  >> 
  >> Especially if the number of items is fairly small.
  >> 
  >> Actually if the extraction is really simple and the extracted key is 
  >> not so small, than ST may perform worse than an ordinary sort doing 
  >> the extraction within the comparison block. The additional array 
  >> creation and destruction and increased memory load will more than 
  >> ofset the lower number of extractions.

  SHC> Who cares?  Modern computers are big enough and fast enough to handle
  SHC> everything except editing movies.

  SHC> The ST is a software pattern.  Once you learn to recognize it, you can
  SHC> use it over and over by simply plugging in the values.  The only thing
  SHC> that changes if the sort-field-extraction functions and whether a '<=>'
  SHC> or 'cmp' appears in the sort.  All the rest is just copy & paste.

and if you can't generate an ST easily enough, try Sort::Maker. it can
do that and 3 other sort styles. when you have a short list of data,
speed of sorting isn't relevant, but easy of coding multikey sorts is
always important. sort::maker allows for easy coding of key extractions
and sorting order. it also can generate the fastest sort style (the GRT) if
you do need speed for larger data sets.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to