<i>Bad performance: tclThreadAlloc vs. CPU-cache (fragmentation/granularity/etc)...</i> status still Open with 3 other changes
by
.
D 2024-11-20T15:50:02.988
J icomment <blockquote>>\sDoes\stclThreadAlloc()\sreally\shave\sbetter\sperformance,\scompared\sto\smodern\smalloc/free\simplementations?</blockquote>\r\n\r\nSingle-threaded\sit\sis\smarginally\sbetter,\showever\sthe\slot\sof\sthe\sload\sremains\sin\suser\sspace,\sand\sdoesn't\sgo\sin\skernel\stime\s(syscalls),\sbecause\sTcl\sworks\snot\sin\snative\sways\swith\smemory\show\sany\sC/C++\sprograms\swould\sdo,\sbut\severything\s(every\sobject,\svar,\shash-element)\sexpects\sat\sleast\s1\sallocation\s(mostly\s2\sor\smore)\sand\salloc/free\sbecomes\sa\smass\sprocessing.<br/>\r\nMulti-threaded\sit\sis\smany,\smany\stimes\ssuperior,\sbecause\smostly\sno\slocking\shappens\s(or\scoarse-grained\slocking\sonly\sif\smore\smemory\sneeded)\sand\salso\stouches\sthe\skernel\srarely.\s\r\n\r\nWith\sOS\sallocator,\sI\ssaw\sa\stenfold\sdegradation\salready\son\s4\sthreads.\r\nIt\sis\slike\sGIL\sin\spython\s(not\sreally\sthat,\sbut\sthe\seffect\slooks\sindeed\svery\ssimilar,\sespecially\swith\sgrowth\sin\sthread\scount).\r\n\r\nSo\syes,\sa\s(smart)\smemory-manager\sis\sstill\sa\smust\sfor\sthings\slike\sTcl,\seven\swith\smodern\sOS.\r\nSurely\swith\sa\sdisadvantage\sof\sin\stcl-core\sreserved\smemory\s(what\scan\salso\sbe\ssolved\swith\sa\sGC,\speriodically\sfreeing\smemory,\sand/or\swith\speriodical\srelease\sof\sworking\sthreads,\sreaching\ssome\sidle\stime).
J login sebres
J mimetype text/x-fossil-wiki
K 3d1c409f1afbca6b74f824cffe8dbb4028a410c5
U sebres
Z 5d02e1ee3b291f4b535b555f5eedae58