Tcl Source Code

View Ticket
Login
Ticket UUID: 1081779
Title: speed up proc calls, improve resolver logic
Type: Patch Version: None
Submitter: msofer Created on: 2004-12-09 01:00:24
Subsystem: 07. Variables Assigned To: msofer
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-12-10 20:11:29
Resolution: Accepted Closed By: msofer
    Closed on: 2004-12-10 13:11:29
Description:
When resolvers are defined, the function
TclInitCompiledLocals marks every variable that has
been found by them with VAR_RESOLVED. This flag avoids
a new lookup until one of the relevant the resolver
epochs changes.

Variables that the resolvers did *not* find (ie,
locals) remain unmarked. This means that the resolvers
will look them up (and fail) at every proc invocation.
If the resolvers do expensive lookups, this may slow
down every proc call considerably.

The attached patch marks every variable with
VAR_RESOLVED, wether it was found or not - i.e.,
VAR_RESOLVED now means VAR_PROCESSED_BY_RESOLVERS.

The patch should be tested with Itcl and Xotcl (the
known resolver users) to insure that my analysis is
coherent with their usage.
User Comments: msofer added on 2004-12-10 20:11:29:

File Deleted - 111914: 



File Added - 111978: initlocals

Logged In: YES 
user_id=148712

Improved patch attached, committed to HEAD: optimised loops
that initialise a proc's arguments and compiled local
variables, removing tests from inner loops.

Provides up to 10% speedup in some tclbench tests.

msofer added on 2004-12-10 05:58:24:

File Added - 111914: initlocals

msofer added on 2004-12-10 05:58:23:
Logged In: YES 
user_id=148712

New patch attached, with improved logic for
TclInitCompiledLocals. This should speed up all Proc
invocations, irespective of the presence of resolvers.

Gustaf reports that the old patch is fine with xotcl, the
new one should be fine too.

msofer added on 2004-12-09 08:00:32:

File Added - 111773: patch

Attachments: