Performance of list / array / dict compared

Liste des GroupesRevenir à cl tcl 
Sujet : Performance of list / array / dict compared
De : rodiongork (at) *nospam* github.com (RodionGork)
Groupes : comp.lang.tcl
Date : 18. Aug 2024, 08:41:37
Autres entêtes
Organisation : novaBBS
Message-ID : <96ddc76b99ce6bf7397a5158fece845f@www.novabbs.com>
User-Agent : Rocksolid Light
Hi Friends!
I've seen here curious thread on comparing TCL speed with Python - and
as a "sequel" to it here is more TCLish observation.
It happened that I was also measuring languages performance (for
practical purpose - to get understanding how much calculations would fit
in 1 second limited sandbox on my site). There are two tests - for plain
integer calculations - and for calculations involving array.
I initially used list as array and while performance is somewhat lower
than with other popular scripting languages, I thought it is quite
decent, regarding list implementation (I thought it is a kind of
space-separated string by then).
Then I browsed TCL tutorial and rewrote implementations using array and
finally, dict. They were
significantly worse, which is explainable as they are not necessarily
tuned to work as linear array - but I was somewhat surprised to see the
"dict" is the worst of all (perhaps it in improved in the versions above
8.5):
C (long long): 4.28
PHP: 11.99
Python3: 42.57
TCL (list): 63.30
TCL (array): 104.78
TCL (dict): 112.41
Lua: 33.75
Implementation is here and you are welcome to check whether I missed
some obvious way to improve results:
https://github.com/rodiongork/languages-benchmark
As a sidenote, PHP and Lua use single version of array for both "linear"
and "dict-like" storage.
--
to email me substitute github with gmail please

Date Sujet#  Auteur
18 Aug 24 * Performance of list / array / dict compared5RodionGork
18 Aug 24 +* Re: Performance of list / array / dict compared3RodionGork
18 Aug 24 i`* Re: Performance of list / array / dict compared2Rich
19 Aug 24 i `- Re: Performance of list / array / dict compared1gustafn
18 Aug 24 `- Re: Performance of list / array / dict compared1Rich

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal