Overview
| Artifact ID: | e1b6e8bc605be4818efdb09425eb5a015c0bb000 |
|---|---|
| Ticket: | 625441ffffffffffffffffffffffffffffffffff
Error in compiling regexp |
| User & Date: | schmitzu on 2002-10-18 22:41:45 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
I've detected an error in the compilation of the regexp command. Put the following code into a file called tstRegexp.tcl: <code> proc isblank {word} { if {[regexp {^[ ]*$} $word]} { puts "is blank" } else { puts "is not blank" } #...some unnecessary lines . . <Repeat this line 1000 times!> . #...some unnecessary lines } puts [time [list isblank "Hello"]] </code> It's *very* important to repeat the comment line!! On my old 400Mhz AMD with WinME and the new ActiveTcl4.0.1 distribution, the output of "tclsh84 tstRegexp.tcl" is: is not blank 94107834 microseconds per iteration Over 90 seconds is a very long time, for such a simple script! With the older Tcl8.3.4 the output varies between 0 and 60000 microseconds. I've looked a little bit deeper into it, and detected that most of the time is wasted in TclCompileRegexpCmd. A little bit deeper in the calling tree it does many recursive calls to duptraverse. The problem seems to be, that the string for the regexp compilation is the whole rest of the proc (including the many comments). I think there is an error in detecting the end of the regexp string?! - foundin changed to: "obsolete: 8.4.0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "schmitzu"
- subsystem changed to: "43. Regexp"
- title changed to: "Error in compiling regexp"
- type changed to: "Bug"