Overview
| Artifact ID: | 7fc5c43cc5fe6b6304b9e7bdf88dbd3703966891 |
|---|---|
| Ticket: | 3302370fffffffffffffffffffffffffffffffff
Performance gap between [global] and [::] |
| User & Date: | ferrieux on 2011-05-15 10:00:16 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
Using [global] instead of [::] in a proc gives a 7x speedup. % proc f {} {global zzz;for {set i 0} {$i<10000000} {incr i} {incr zzz}} % proc g {} {for {set i 0} {$i<10000000} {incr i} {incr ::zzz}} % time f 871320 microseconds per iteration % time g This can be traced to the different bytecode ops used: in the tight loop, the [global] case uses a compiled local (upvarred to the global), while the FQN uses loadScalarStk repeatedly. I would have assumed that the intrep cacheing of the resolved varname in that literal value "::zzz" would save most of the work, but something else must be increasing the cost... 6123508 microseconds per iteration - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "ferrieux"
- subsystem changed to: "07. Variables"
- title changed to: "Performance gap between [global] and [::]"
- type changed to: "Bug"