Re: Really strange performance problem with string map vs regsub
- From: Stephan Kuhagen <skuhagen@xxxxxx>
- Date: Sun, 29 Jul 2007 22:23:28 +0200
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
.
- References:
- Re: Really strange performance problem with string map vs regsub
- From: Jeff Hobbs
- Re: Really strange performance problem with string map vs regsub
- From: Jeff Hobbs
- Re: Really strange performance problem with string map vs regsub
- Prev by Date: Re: serial port: fconfigure -handshaking fails
- Next by Date: Re: Web Services
- Previous by thread: Re: Really strange performance problem with string map vs regsub
- Next by thread: Question about the 'expr' command in tcl
- Index(es):
Relevant Pages
|
Loading