Sujet : TCL PERFORMANCE : how to rid of 'Tcl_EvalObjv' with the 'NRE' stuff
De : aotto1968 (at) *nospam* t-online.de (aotto1968)
Groupes : comp.lang.tclDate : 04. Apr 2025, 14:55:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsood1$3ijij$1@dont-email.me>
User-Agent : Mozilla Thunderbird
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.