in reply to compiling perl scripts aka why is perl not as fast as C
What makes development fast is the use of the flexible scalar type. What makes the code "slow" is the use of the flexible scalar type.
strict typing doesn't by itself contribute to any speed gains, does it?
Actually, it has everything to do with it. int y = x; is two machine opcodes, and the optimiser can reduce the number of opcodes the next statement takes if it uses x or y. On the other hand, my $y = $x; require memory allocation, type checks, magic checks, and support to copy the string, the integer, the float and/or whatever else might be contained by $x.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: compiling perl scripts aka why is perl not as fast as C
by punkish (Priest) on Mar 21, 2010 at 05:56 UTC | |
by ikegami (Patriarch) on Mar 21, 2010 at 06:16 UTC | |
by cdarke (Prior) on Mar 21, 2010 at 11:36 UTC | |
by ikegami (Patriarch) on Mar 21, 2010 at 18:29 UTC | |
by LanX (Saint) on Mar 21, 2010 at 12:24 UTC |