Artifacts Associated With Ticket 903765ffffffffffffffffffffffffffffffffff
Ticket change [d4436c8a92] (rid 123415) by dgp on 2004-02-24 22:07:40:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
It's been noted on the Wiki... http://wiki.tcl.tk/9585 that the runtime of expr 1[string repeat +1 $N] is quadratic in $N. This is due to Tcl_ParseExpr(). After each + is parsed in ParseAddExpr(), a call is made to PrependSubExprTokens to shift the already parsed operands down the token array to make room for the operand token at the beginning. This means that $N times, $n tokens are copied (as $n grows from 1 to $N) just to get the parsing done -- quadratic complexity. Similar issues arise with other expressions that call PrependSubExprTokens. For most short expressions, this penalty hardly matters, but a more scalable parser would be nice. - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "avoid quadratic parsing time"
- type initialized to: "RFE"
Ticket change [7204a2885c] (rid 100789) by dgp on 2004-03-09 00:46:25:
- icomment:
Logged In: YES user_id=80530 The conceptually obvious fix would be for the expr parser to stop trying to fill a linear Tcl_Token array on the fly, and instead have the parser build an actual parse tree. Then when the parse tree is complete, a simple traversal can create the Tcl_Token array in linear time. It's a simple transformation in concept, but a fairly substantial rewrite of generic/tclParseExpr.c. A nice limited project for someone who wants to get started hacking the core. Who needs a project?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [a08b8b9b86] (rid 96831) by dgp on 2004-03-10 06:00:07:
- icomment:
Logged In: YES user_id=80530 Anyone tackling such a rewrite should look into solving Tcl Bug 906201 at the same time.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [261500f30e] (rid 88277) by dgp on 2006-07-05 12:34:42:
- assignee changed to: "dgp"
- closedate changed to: "2006-07-05T05:34:42"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Implemented for 8.5a5
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"
- username: "dgp"