Sujet : Re: tcl versa python regarding performance
De : aotto1968 (at) *nospam* t-online.de (aotto1968)
Groupes : comp.lang.tclDate : 15. Aug 2024, 14:04:10
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v9kuca$v56o$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 14.08.24 14:04, Gerald Lester wrote:
On 8/14/24 04:16, aotto1968 wrote:
the first analyses is quite simple:
>
right now python does NOT support threads in NHI1 (will change soon) and tcl does…
this has an influence on the "release" build because this is NHI1 without threads in python and with
threads in tcl.
>
→ the difference is that the thread-local-storage is an STATIC REFERENCE in python and a POINTER in tcl.
>
→ the "aggressive" build does NOT use threads at all and the change between python and tcl is more compare-able
but is still ~20%
>
I think the point that androwish was making, without seeing the code we can not tell if you did something in a way that takes more time than doing it in a slightly different way.
I use the kcachegrind to debug the performance but there are a lot of "small" points to end-up in the ~20% loss against python.
-> I cannot post a "picture" because the "newsgroup does NOT accept pictures …
-> must of the code is in the TCL-C-Api for example:
Example my "ServiceCall" function: at the end of a service call I use:
if (ret == TCL_OK) {
Tcl_ResetResult(interp);
return MkErrorGetCode_0E();
}
and this simple "Tcl_ResetResult" eat 0,8% of the total performance → this is 75% of my "ServiceCall" performance.
-> not trivial, it seems that the Python people with a lot of “manpower” have already MAXIMIZED the optimization of Python.
If I step in Tcl_ResetResult the highlight is:
% eat Total performance -> function name
1,09% -> ResetObjectResult
0,54% -> FreeByteArrayInternalRep (this object is variable size around ~ 1000 bytes)
mfg ao