[Chicago-talk] Removing "." from a string?

Andy_Bach at wiwb.uscourts.gov Andy_Bach at wiwb.uscourts.gov
Thu Jan 31 17:26:25 PST 2008


> 
Benchmark: timing 10000000 iterations of joinmatch, splitjoin, subst, tr, 
whileindex...
 joinmatch:  3 wallclock secs ( 3.06 usr +  0.00 sys =  3.06 CPU) @ 
3267973.86/s (n=10000000)
 splitjoin:  3 wallclock secs ( 3.92 usr +  0.00 sys =  3.92 CPU) @ 
2551020.41/s (n=10000000)
     subst:  1 wallclock secs ( 0.90 usr +  0.00 sys =  0.90 CPU) @ 
11111111.11/s (n=10000000)
        tr:  1 wallclock secs ( 1.51 usr +  0.00 sys =  1.51 CPU) @ 
6622516.56/s (n=10000000)
whileindex:  2 wallclock secs ( 2.85 usr +  0.00 sys =  2.85 CPU) @ 
3508771.93/s (n=10000000)

Just a test:
Benchmark: timing 10000000 iterations of joinmatch, splitjoin, subst, tr, 
whileindex...
 joinmatch:  4 wallclock secs ( 3.04 usr +  0.00 sys =  3.04 CPU) @ 
3289473.68/s (n=10000000)
 splitjoin:  4 wallclock secs ( 4.03 usr +  0.00 sys =  4.03 CPU) @ 
2481389.58/s (n=10000000)
     subst:  2 wallclock secs ( 1.02 usr +  0.00 sys =  1.02 CPU) @ 
9803921.57/s (n=10000000)
        tr:  3 wallclock secs ( 1.49 usr +  0.00 sys =  1.49 CPU) @ 
6711409.40/s (n=10000000)
whileindex:  4 wallclock secs ( 2.90 usr +  0.00 sys =  2.90 CPU) @ 
3448275.86/s (n=10000000)

and w/o invoking the 'RE Beast' I just tested tr:
Benchmark: timing 10000000 iterations of tr...
       tr:  1 wallclock secs ( 1.39 usr +  0.00 sys =  1.39 CPU) @ 
7194244.60/s (n=10000000)
Benchmark: timing 10000000 iterations of tr...
        tr:  1 wallclock secs ( 1.27 usr +  0.00 sys =  1.27 CPU) @ 
7874015.75/s (n=10000000)

I know somewhere it says tr/// is the fastest route but the simplicity of 
the subst RE maybe part of the anomalous result. Tried:
Benchmark: timing 10000000 iterations of joinmatch, substD, substcharclas, 
substdot, tr...
 joinmatch:  2 wallclock secs ( 2.84 usr +  0.00 sys =  2.84 CPU) @ 
3521126.76/s (n=10000000)
    substD:  1 wallclock secs ( 1.01 usr +  0.00 sys =  1.01 CPU) @ 
9900990.10/s (n=10000000)
substcharclas:  1 wallclock secs ( 1.28 usr +  0.00 sys =  1.28 CPU) @ 
7812500.00/s (n=10000000)
  substdot:  2 wallclock secs ( 1.29 usr +  0.00 sys =  1.29 CPU) @ 
7751937.98/s (n=10000000)
        tr:  1 wallclock secs ( 1.27 usr +  0.00 sys =  1.27 CPU) @ 
7874015.75/s (n=10000000)

and \D still beats them all. Huh.

a

Andy Bach
Systems Mangler
Internet: andy_bach at wiwb.uscourts.gov
VOICE: (608) 261-5738  FAX 264-5932

"The Microsoft Exchange Information Store service depends on
the Microsoft Exchange Directory service which failed to
start because of the following error:
The operation completed successfully."
(actual MSE error msg)



More information about the Chicago-talk mailing list