Tcl Source Code

View Ticket
Login
Ticket UUID: 1830166
Title: improve [regexp] performance
Type: Patch Version: None
Submitter: hobbs Created on: 2007-11-12 02:01:54
Subsystem: 43. Regexp Assigned To: hobbs
Priority: 7 High Severity:
Status: Closed Last Modified: 2007-11-12 09:09:18
Resolution: Fixed Closed By: hobbs
    Closed on: 2007-11-12 02:09:18
Description:
The attached patch extends the basic conversion of static RE to simple glob in several ways ...

* TclReToGlob function created that does some more extensive conversions, but still conservative to what is possible
* Add INST_REGEXP that does simple [regexp ?-nocase? ?--? $exp $str] fully compiled
* Use TclReToGlob in the compilation of regular expressions and cache the result
* Use cached glob whenever a RE evaluation is requested that matches the profile (has glob equiv, doesn't request match info, no offset, etc)
User Comments: hobbs added on 2007-11-12 09:09:18:
Logged In: YES 
user_id=72656
Originator: YES

Applied for 8.5b3.

Note that this also takes effect in some -regexp option usage by commands (wherever Tcl_RegExpExecObj is called with 0 offset, 0 matches and 0 flags with an RE that has a glob equiv).

hobbs added on 2007-11-12 09:01:54:

File Added - 253873: retoglob.diff

Attachments: