Skip to content
Tcl Source Code History Of Ticket 218556
Login

History Of Ticket 218556

Artifacts Associated With Ticket 218556

  1. Ticket change [5de72b5c09] (rid 115547) by nobody on 2000-10-26 01:02:08:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 1063 Bug
      Version: 8.1b1
      SubmitDate: '1999-01-15'
      LastModified: '1999-08-04'
      Severity: SER
      Status: Released
      Submitter: pat
      ChangedBy: stanton
      OS: Windows NT
      OSVersion: 4.0
      Machine: X86
      FixedDate: '1999-06-01'
      FixedInVersion: 8.1.1
      ClosedDate: '2000-10-25'
      
      
      Name:
      vince darley
      
      Extensions:
      none
      
      CustomShell:
      none
      
      ReproducibleScript:
      proc scancontext {cmd args} {
          switch $cmd {
      "create" {
          uplevel 1 {
      set __scan 0
      while {[array exists scancontext$__scan]} {
          incr __scan
      }
      set scancontext[set __scan]() 1
      return scancontext$__scan
          }
      }
      "delete" {
          upvar [lindex $args 0] scan
          unset scan
      }
          }
      }
      
      proc scanmatch {scanid regexp script args} {
          if {[string match "-*" $scanid]} {
      set flags $scanid
      set scanid $regexp
      set regexp [list $flags $script]
      set script [lindex $args 0]
          } else {
      set regexp [list -- $regexp]
          }
          upvar $scanid scan
          set scan($regexp) $script
          return $scanid
      }
      
      proc scanfile {scanid fid} {
          upvar $scanid scan
          upvar matchInfo m
          set m(linenum) 0
          set m(offset) 0
          while {[set count [gets $fid m(line)]] >= 0} {
      incr m(linenum)
      incr m(offset) $count
      foreach reg [array names scan] {
          if {$reg == ""} {continue}
          if {[regexp [lindex $reg 0] [lindex $reg 1] $m(line)  "" m(submatch0) m(submatch1) m(submatch2)]} {
      uplevel 1 $scan($reg)
          }
      }
          }
      }
      
      proc test {} {
          global tk_library
          set cid_scan [scancontext create]
          scanmatch $cid_scan  "^\[ \t\]*(proc|while|if|blah)" {
      incr count 1
          }
          scanmatch $cid_scan "^\[ \t\]*(foreach|namespace|global)" {
      incr count 1
          }
      
          set count 0
          foreach f [glob -nocomplain [file join $tk_library *.tcl]] {
      if {![catch {open $f} fid]} {
          scanfile $cid_scan $fid
          close $fid
      }
          }
      
          scancontext delete $cid_scan
      
      }
      
      time test 10
      
      ObservedBehavior:
      Running this script under Tcl 8.0.4 takes 2.4 seconds per iteration.
      Under Tcl 8.1a2 it was about 7.5 times slower
      Under Tcl 8.1b1 it is SEVENTEEN (yes 17) times slower than Tcl 8.0.4, it takes more than 40 seconds per iteration.
      
      The script basically makes repeated use of simple regexp's like 
      
      "^\[ \t\]*(proc|while|if|blah)"
      
      DesiredBehavior:
      I expect regexps using the new engine to be faster, not slower than tcl8.
      In particular, a slowdown of a factor of 17 is simply unacceptable.  I will never be able to use Tcl 8.1 in many of my applications if this is not fixed.
      
      
      
      This is a known bug.  This, rather extensive example, points out that a global regexp object needs
      to be cached and reused when compiling regular expressions.  This will prevent the shimmering.
      03/23/1999 18:00 - surles -
      
      A second level cache has been added that should fix this problem.
      05/12/1999 18:38 - stanton -
      
      
      
    4. foundin initialized to: "obsolete: 8.1b1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "43. Regexp"
    10. title initialized to:
      Tcl8.1b1 regexp's are now 17 times slower than in Tcl8.0.4
      
    11. type initialized to: "Bug"
  2. Ticket change [f5d25cbb3a] (rid 130181) by welch on 2000-10-26 08:24:14:

    1. closedate changed to: "2000-10-26T01:24:14"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"