Not really a bug, but it seems that remote interp alias invocation has gotten a lot slower. Like 10 times.
Here is the output from attached reproducable script.
TCL='8.3.4'
PROC : 2 microseconds per iteration
LOCALALIAS: 3 microseconds per iteration
SUBINTERP : 4 microseconds per iteration
TCL='8.4.13'
PROC : 1.455 microseconds per iteration
LOCALALIAS: 2.062 microseconds per iteration
SUBINTERP : 2.376 microseconds per iteration
TCL='8.5a3'
PROC : 2.251 microseconds per iteration
LOCALALIAS: 3.678 microseconds per iteration
SUBINTERP : 19.705 microseconds per iteration
TCL='8.5a5'
PROC : 2.128 microseconds per iteration
LOCALALIAS: 3.045 microseconds per iteration
SUBINTERP : 22.788 microseconds per iteration
This last is on Linux and configured with:
./configure --enable-symbols --disable-shared
Output alias invocation times.
Logged In: YES
user_id=190660
Originator: YES
I ran gprof profiling and tracked the slowdown to TclTransferResult(), in particular near the end, there was a change:
< (Interp *) targetInterp)->returnCode = ((Interp *) sourceInterp)->returnCode;
---
> Tcl_SetReturnOptions(targetInterp,
Tcl_GetReturnOptions(sourceInterp, result));
Setting this back restores performance???
Logged In: YES
user_id=190660
Originator: YES
Ah. It looks like this involves the [return] enhancements.
I wonder if something like the following might be feasible,
as it restores performance:
if (result == TCL_OK && iPtr->returnOpts==NULL) {
((Interp *) targetInterp)->returnCode = ((Interp *) sourceInterp)->returnCode;
} else {
Tcl_SetReturnOptions(targetInterp,
Tcl_GetReturnOptions(sourceInterp, result));
iPtr->flags &= ~(ERR_ALREADY_LOGGED);
}
Logged In: YES
user_id=72656
Originator: NO
Don did the return additions, so I'll let him comment.
Logged In: YES
user_id=80530
Originator: NO
That's the right idea, but the patch
I'm committing is a bit different in
the details.
Thanks for reporting the issue.