Overview
| Artifact ID: | df36715a00779552de1f4c4266c3331f8a106727 |
|---|---|
| Ticket: | 1452969fffffffffffffffffffffffffffffffff
performance: regexp 20sec delay from 8.0 to 8.3 |
| User & Date: | msofer on 2006-03-18 20:35:13 |
Changes
- foundin changed to: "obsolete: 8.4.13"
- icomment:
Logged In: YES user_id=148712 The performance confirmed bad on modern Tcl (8.3 is already quite old, if you are migrating you should use 8.4). Since 8.0 the regexp engine has been completely replaced; the new unicode awareness does make it slower. However, for your particular case, the use of regexp is probably not necessary: a combination of [string last] and [string range] is much more efficient. Look: % time { if {[set n [string first = $sEnvPair]] != -1} { set sEnvName [string range $sEnvPair 0 [expr {$n-1}]] set sEnvValue [string range $sEnvPair [incr n] end] } } 1000 168.87 microseconds per iteration % time { if {[regexp {^(.*)=(.*)$} $sEnvPair sDummy sEnvName sEnvValue] == 1} { } } 22609833 microseconds per iteration BTW: priority 9 is for release-blocking bugs; this is nowhere near qualifying. - login: "msofer"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- title changed to: "performance: regexp 20sec delay from 8.0 to 8.3"
- username: "msofer"