Overview
| Artifact ID: | a6c5990a8c56d60e8b52d8df29d244f9839b4bc9 |
|---|---|
| Ticket: | 1165671fffffffffffffffffffffffffffffffff
inefficient bytecode for [incr x -1] |
| User & Date: | dgp on 2005-03-17 23:42:19 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
During the CONST reforms leading up to Tcl 8.4 that allowed const strings to be passed to Tcl_Eval(), etc... a call to TclLooksLikeInt() was replaced by TclParseInteger() in the TclCompileIncrCmd() routine. TclLooksLikeInt() allows for leading whitespce and + and -, while TclParseInteger() does not. So the test doesn't pass as often as it used to, or as it should. When the test passes, immediate operands are compiled into the bytecode allowing for more efficient execution. As it happems, TclLooksLikeInt() is happy and safe to use with const strings. The attached patch restores it, which allows increments containing whitespace and leading sign characters to be compiled to more efficient bytecode. The most notable case is probably [incr x -1]. Will be interesting to see if this change shows up in any benchmarks.
- foundin changed to: "obsolete: 8.4.9"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "47. Bytecode Compiler"
- title changed to: "inefficient bytecode for [incr x -1]"
- type changed to: "Bug"