in reply to Trading compile time for faster runtime?
As an example, a few years ago I added the 'multiconcat' operator, which merges a series of concatenations (such as $x .= "-$y-") into a single op. Since the op can see the whole picture, it can be a lot more efficient - such as just allocating a final string buffer of the right size once, rather than repeatedly growing and reallocating the string. It should have been simple, but turned out to be really hard, and broke a whole bunch of CPAN modules. The runtime implementation of the multiconcat operator is about 700 lines of C code - it turns out that concatenating strings in perl is non-trivial.
Dave.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Trading compile time for faster runtime?
by melez (Sexton) on Apr 21, 2022 at 09:38 UTC |