in reply to When does it pay to use the schwartzian transform?
If the transformation is expensive relative to building an arrayref and dereferencing it, the ST will give you gains in efficiency as the number of elements to be sorted increases, because you do the transformation exactly once per element.
Another way to get the do-it-only-once efficiency would be to Memoize (or cache the results from) the transformation function.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: When does it pay to use the schwartzian transform?
by BrowserUk (Patriarch) on Dec 16, 2005 at 20:15 UTC |