in reply to Perl at Rosetta Code, with one particular example
Two things (so far).
Slurping a file and regexing out what you want is faster than reading the file line by line in a while loop (in my experience).
Hash slices are faster than separate lookups (ditto).
My general rule for speed is to try to do as much as you can in the perl interpreter, as opposed to the perl language. See Re: converting binary to decimal as an example.
Try to do operations on groups of things, not the individual elements.
Recheck the RosettaCode page :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl at Rosetta Code, with one particular example
by Anonymous Monk on Jun 12, 2025 at 06:41 UTC |