in reply to Malformed Schwartzian Transforms

And here is a lesson that was lost on virtually everyone in the thread.

The Schwartzian Transform is an optimization. Starting off writing a sort by by saying, "I'm going to write a Schwartzian Transform because it is slow" is premature optimization. Don't micro-optimize a step that is probably miniscule in the overall scheme of things.

In the specific example that you give, the transform is justifiable not by performance, but by the fact that you avoid having to write parallel pre-processing logic for $a and $b. At which point there is a rationale for moving all of the complexity into the first map (put all of the data processing logic in one place), but it is a minor win at best.

Replies are listed 'Best First'.
Re: Re: Malformed Schwartzian Transforms
by ihb (Deacon) on Apr 10, 2004 at 18:05 UTC

    Indeed. I seldom need to care about optimization yet I often use Schwartzian Transforms as an OAOO technique.

    ihb

      OAOO

      <TPB> You keep using that word. I do not think it means what you think it means. </TPB>