diff options
author | Karl Williamson <khw@cpan.org> | 2020-01-17 11:51:32 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-01-18 12:51:43 -0700 |
commit | 129ccace6b45e3574c0b430b1fbcc7f8d0aa8e50 (patch) | |
tree | 93b168b0a6fa4615bb464293a889c9096f594136 /README.os390 | |
parent | aab74eb88a8406c6b35abf52902200f70a832d85 (diff) | |
download | perl-129ccace6b45e3574c0b430b1fbcc7f8d0aa8e50.tar.gz |
Refactor grok_number_flags to speed it up
This uses a variety of techniques to improve the performance.
The chief one is to switch on the input length for the unrolled part of
the loop, like is done in grok_bin_oct_hex(). This eliminates having to
check if we are at the end of the string each time we process and
advance a digit through it.
Explicit branch predictions were added. One assumes that the input
won't have a sign more frequently than it does have one.
Some setup conditionals were eliminated. One way is that this ignores
leading spaces. Previously, it just advanced through any and then
checked if we are at the end of the string after having done so. That
check can be eliminated if we didn't advance.
Also, I check for a sign with a single conditional, eliminating a check
for minus, then, if not found, one for plus. Instead, if it is a sign,
there is an extra check for which one. Thus it rewards unsigned input,
and penalizes signed, by a single conditional each way.
Diffstat (limited to 'README.os390')
0 files changed, 0 insertions, 0 deletions