Re: Really strange performance problem with string map vs regsub



Jeff Hobbs wrote:

The ***= case is simply one that has not been optimized with my special
check, and that is the numbers you would get from the RE without the
special case. I suppose I could extend the code to check for that, but
people should just rely on 'string map'. In addition, you can better
verify the effects of this special case by choosing something that will
foil it. This is meant to find 1:1 simple mappings being passed through
regsub. Simply make either the search or replace "non-simple" (ie, add
an escaped char), and you will lose all speed gains.

Thanks for explaining that. I think, string map will be it. But just out of
curiosity I made some more Tests on different CPU, all running Linux and
the mentioned version of Tcl. I tested:

1 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
2 Intel(R) Pentium(R) 4 CPU 3.00GHz
3 Intel(R) Pentium(R) 4 CPU 3.40GHz
4 Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz
5 PowerPC 750FX @ 800Mhz

"string map" is only faster on 1 and 3, the others are faster with regexp.
I'm wondering what magic the assembler does there...

Regards
Stephan

.



Relevant Pages

  • Re: slow HP Ze4200 series notebook
    ... Yes, to extend battery life, laptops are underclockd. ... I am concerned about the CPU speed - ... | L1 Trace Cache 12K Instructions ...
    (microsoft.public.windowsxp.hardware)
  • Re: [git-pull -tip] x86: cpu_debug patches
    ... it means that for every new CPU type that comes ... the CPU features that are displayed here, ... 'cpu model' enumeration but instead be CPU feature flags driven. ... That way we reuse the existing cpu_has checks and extend them. ...
    (Linux-Kernel)
  • Re: [PATCH 1/2] tracing/core: introduce per cpu tracing files
    ... (provided you have a debugfs mountpoint on /debug). ... trace file and one latency_trace file per cpu. ... extend the list of per CPU attributes as well, ...
    (Linux-Kernel)

Loading