• TCL PERFORMANCE : how to rid of 'Tcl_EvalObjv' with the 'NRE' stuff

    From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Fri Apr 4 15:55:45 2025
    From Newsgroup: comp.lang.tcl


    I'm in the phase of optimization of the new ATL tcl dialect using "myoo" OO extension and right now I'm fight to get
    PYTHON speed for an EMPTY callback.

    → The CORE problem is the "Tcl_EvalObjv" which is TO SLOW to beat python.


    exec[#7] -> '.../release/example/c/perfclient' '--send-nothing' '--sec' '10' '@' 'python3' '.../example/py/perfserver.py'
    ...:PerfClientExec }: start ------------------------ : result [ count / sec ]
    ...:statistics }: --send-nothing : 504821.1 [ 5048489 / 10.000551 ]
    ^^^^^^^^^^^^^^^^^^^^^
    ...:PerfClientExec }: end: ----------------------------------------
    exec[#7] -> '.../release/example/c/perfclient' '--send-nothing' '--sec' '10' '@' 'tclsh8.6' '.../example/atl/perfserver.atl'
    ...:PerfClientExec }: start ------------------------ : result [ count / sec ]
    ...:statistics }: --send-nothing : 453027.1 [ 4530432 / 10.000355 ]
    ^^^^^^^^^^^^^^^^^^^^^
    ...:PerfClientExec }: end: ----------------------------------------


    → The CORE problem is the "NRE" which eats the performance

    *----------------------------------------------------------------------
    *
    * Tcl_EvalObjv --
    *
    * This function evaluates a Tcl command that has already been parsed
    * into words, with one Tcl_Obj holding each word.
    *
    * Results:
    * The return value is a standard Tcl completion code such as TCL_OK or
    * TCL_ERROR. A result or error message is left in interp's result.
    *
    * Side effects:
    * Always pushes a callback. Other side effects depend on the command.
    *
    *----------------------------------------------------------------------
    */

    int
    Tcl_EvalObjv(
    Tcl_Interp *interp, /* Interpreter in which to evaluate the
    * command. Also used for error reporting. */
    int objc, /* Number of words in command. */
    Tcl_Obj *const objv[], /* An array of pointers to objects that are
    * the words that make up the command. */
    int flags) /* Collection of OR-ed bits that control the
    * evaluation of the script. Only
    * TCL_EVAL_GLOBAL, TCL_EVAL_INVOKE and
    * TCL_EVAL_NOERR are currently supported. */
    {
    int result;
    NRE_callback *rootPtr = TOP_CB(interp);

    result = TclNREvalObjv(interp, objc, objv, flags, NULL);
    return TclNRRunCallbacks(interp, result, rootPtr);
    }

    → Is there a possible to get an "Tcl_EvalObjvEx" as striped version of all the NRE stuff?


    mfg.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Fri Apr 4 18:06:49 2025
    From Newsgroup: comp.lang.tcl

    On 04.04.25 15:55, aotto1968 wrote:

    I'm in the phase of optimization of the new ATL tcl dialect using "myoo" OO extension and right now I'm fight to get
    PYTHON speed for an EMPTY callback.

    → The CORE problem is the "Tcl_EvalObjv" which is TO SLOW to beat python.


    exec[#7] -> '.../release/example/c/perfclient' '--send-nothing' '--sec' '10' '@' 'python3' '.../example/py/perfserver.py'
    ...:PerfClientExec                }: start ------------------------ :     result [    count / sec        ]
    ...:statistics                    }:                 --send-nothing :   504821.1 [  5048489 / 10.000551  ]
                                                                           ^^^^^^^^^^^^^^^^^^^^^
    ...:PerfClientExec                }: end: ----------------------------------------
    exec[#7] -> '.../release/example/c/perfclient' '--send-nothing' '--sec' '10' '@' 'tclsh8.6' '.../example/atl/perfserver.atl'
    ...:PerfClientExec                }: start ------------------------ :     result [    count / sec        ]
    ...:statistics                    }:                 --send-nothing :   453027.1 [  4530432 / 10.000355  ]
                                                                           ^^^^^^^^^^^^^^^^^^^^^
    ...:PerfClientExec                }: end: ----------------------------------------


    ...

    more updates:

    1. tclwiki: https://wiki.tcl-lang.org/page/How+can+I+get+rid+of+the+NRE
    2. facebook (picture): https://www.facebook.com/permalink.php?story_fbid=pfbid02hyjRgvy8DtytrCfZmAeK6nAAtnp9axmLEQJ17yCEB3wCvh6ZdpYRnijDopQSoD5gl&id=100069563501101

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Mon Apr 7 22:25:15 2025
    From Newsgroup: comp.lang.tcl

    As I fought - the CORE problem was TCL8.6 which lost ~10%-20% of performance against PYTHON.

    I use for ATL and myoo now a slightly modified 8.5.19 which has almost PYTHON speed make myoo to one of fastest OO in the
    scripting sky
    With 8.5.19 I get rid of tcloo and NRE
    ATL and myoo works for version tcl8.6 also

    → results: https://wiki.tcl-lang.org/page/How+can+I+get+rid+of+the+NRE
    --- Synchronet 3.20c-Linux NewsLink 1.2