Artifacts Associated With Ticket 2613766fffffffffffffffffffffffffffffffff
Ticket change [c9aa37f446] (rid 122329) by dgp on 2009-02-18 19:46:23:
- assignee initialized to: "pvgoran"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Something since 8.6b1 has dropped the performance of the tclbench test noted in the summary by about a factor of 2.
- foundin initialized to: "obsolete: 8.6b1.1"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "43. Regexp"
- title initialized to: ""RE var backtrack case" lost performance"
- type initialized to: "Bug"
Ticket change [44e537b4ca] (rid 116785) by dgp on 2009-02-19 09:50:42:
- icomment:
A bit less cryptically this script demo's the slowdown: proc demo {s e} { regexp $e $s } demo a[string repeat b 200] a.*b.*c - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [791d05e750] (rid 90067) by dgp on 2009-02-22 11:59:17:
- assignee changed to: "dkf"
- icomment:
some bisection blames the "NRE-enable [source]" commit from 2009-01-05 for the loss.
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "7 High"
- username: "dgp"
Ticket change [a991395aa5] (rid 99167) by dkf on 2009-02-22 21:43:43:
- icomment:
That would (probably) indicate a shimmering problem. I didn't do anything with the RE code in that commit.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [54fad039bb] (rid 94048) by dgp on 2009-02-23 09:58:41:
- icomment:
The difference is due to the objtype of $::str when that test runs. In older Tcl, it's the "string" Tcl_ObjType; in the current HEAD it's an untyped value. Then the performance difference is the difference between doing a glob match on a unicode array or on a utf encoded string.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d4682fe0e8] (rid 123437) by hobbs on 2009-02-23 10:10:47:
- icomment:
I haven't checked the specifics, but note the a.*b.*c RE case was made slower by my changes to REToGlob at some point. They sped up the more common a.*b, but more than one .* shows the RE is still faster. I never got around to the code that counts the .*'s and falls back to RE with more than 1 present.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [a6ac98b33a] (rid 98646) by dgp on 2009-02-23 12:00:31:
- icomment:
The simplest way to restore the lost performance is to add the flag TCL_EVAL_DIRECT to the TclNREvalObjEx() call at line 1869 of file tclIOUtil.c That change also solves the failing tests in info.test (2487771). Unfortunately, it also causes test source-8.1 to fail. This raises some questions. Is the TCL_EVAL_DIRECT flag supposed to be a valid thing to pass to TclNREvalObjEx() ? If so, why is it causing source-8.1 to fail? If not, why is there still code in that routine to handle that flag? Also, what about all the callers? Do they all take care to be sure that flag value doesn't flow through?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [542eeed405] (rid 93898) by dgp on 2009-02-23 12:31:11:
- icomment:
Assuming that change isn't feasible, the performance loss comes down to a difference in the objtype of words produced by TclSubstTokens and by TclCompileTokens.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [a79b057f49] (rid 98832) by dgp on 2009-02-23 20:10:57:
- icomment:
the other knob to twist on this one is to look at the handful of places that operate on the unicode array rep of a value iff the value already has the "string" objType. Might make sense to broaden that net to capture untyped values as well. We still avoid shimmering away intreps of other types that might have value, and this test at least suggests that the performance gains of working with unicode are so significant that they win even if you have to create the unicode rep from scratch as part of the operation.
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- username: "dgp"
- icomment:
Ticket change [0c5affc59c] (rid 114161) by dgp on 2009-02-24 05:40:40:
- icomment:
Other tests with more modest performance loss due to the same commit are: 460 SPLIT iter, rand 100 c 471 SPLIT, rand 100 c 483 STR append (10KB + 1KB) These in addition to the original report about benchmark: 420 RE var backtrack case The slowdowns of both 420 and 483 are corrected by adding the TCL_EVAL_DIRECT flag.
- login: "dgp"
- mimetype: "text/plain"
- title changed to: "performance loss from NRE-enable of [source]"
- username: "dgp"
- icomment:
Ticket change [391113faba] (rid 112322) by dgp on 2009-02-25 04:44:08:
- icomment:
For benchmark 483, the loss is completely due to a realloc() call changing from one that can return the same pointer value to an enlarged space to one that must return a different pointer value. Apparently a symptom of memory fragmentation.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [bfef3d12f9] (rid 102332) by dgp on 2009-02-26 02:59:36:
- assignee changed to: "dgp"
- closedate changed to: "2009-02-25T19:59:36"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 fixed by creating/using unicode rep on untyped values.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"