Menu

#3611 remote alias invocation 10x slowdown

obsolete: 8.5a5
closed-fixed
6
2007-01-29
2007-01-02
No

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

Discussion

  • Peter MacDonald

    Peter MacDonald - 2007-01-02

    Output alias invocation times.

     
  • Peter MacDonald

    Peter MacDonald - 2007-01-03

    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???

     
  • Peter MacDonald

    Peter MacDonald - 2007-01-03

    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);
    }

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-01-03

    Logged In: YES
    user_id=72656
    Originator: NO

    Don did the return additions, so I'll let him comment.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-01-03
    • priority: 5 --> 6
    • assigned_to: hobbs --> dgp
     
  • Don Porter

    Don Porter - 2007-01-29
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2007-01-29

    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.