Tcl Source Code

Artifact [3b7a57eb57]
Login

Artifact 3b7a57eb57f407bbb71ebaa61f8cadea76590f0004e0246f5e6f3bcc672b8b32:

Ticket change [3b7a57eb57] - Ticket [28cc67a606] array set from dict: set values multi times on the same array is slower with Tcl9.0. status still Open with 3 other changes by sebres 2024-04-16 17:22:57.
D 2024-04-16T17:22:57.926
J icomment This\sdefinitely\sbelongs\sto\sabstract-lists\simplementation\sof\s9.0\sand\salthough\sit\swas\ssupposed\sto\sbe\sbetter\s(avoid\sshimmer\sof\sdict\sto\slist),\sin\sthe\sreality\sit\sis\srather\sworse\snow:\r\n\r\n-\slist\sfacilities\spreviously\shandles\spure-dicts\sbetter\s(even\sif\sit\sshimmered\ssometimes\sbetween\slist/dict).\r\n-\sby\sretrieving\sof\slength\s(DictAsListLength)\snow\sit\salways\sobtain\sstring\srepresentation\sof\sdict\s(also\sfor\spure-dict\sobject),\swhat:\r\n\s\s\s*\smay\sbe\sslow\sand\s\r\n\s\s\s*\scauses\sthat\sdict\sobject\sis\snot\spure\sanymore\s(basically\swe\sneed\sa\sflag\sfor\sthat,\sto\smark\spure-dicts\sindependently\sto\sexistence\sof\sits\sstring\srepresentation)\r\n-\sDictAsListLength\s(but\sbasically\sObjType::LengthProc)\scannot\shandle\serrors,\swhat\smay\sbe\snot\sso\sgood\sfor\sa\spossible\sfallback\s(if\sdict\sis\snot\spure\sdict);\r\n-\sretrieving\sof\sindex\s(if\sone\swould\simplement\sit\sfor\sdict),\se.\sg.\sfor\sINST_FOREACH_STEP/INST_FOREACH_START\sinstructions,\sis\shardly\spossible,\sbecause\r\nnormal\siteration\sover\sthe\sdict\sneeds\ssome\sinterim\sTcl_DictSearch\s(or\ssimilar\siterator\shandle),\sand\swithout\sthat\swe'll\sget\sO(n!)\saka\sfactorial\sbig-O\sif\sit'd\salways\sstart\sfrom\sscratch\sand\sstop\sat\sindex.\r\n-\sObjType::GetElements\smay\sbe\stoo\shard\s(for\slarge\sdicts)\sand\sit\sis\sunused,\sand\srightly\sso,\sfor\sINST_FOREACH_STEP/INST_FOREACH_FIRST\sinstructions.\r\n-\sthere\sis\sno\sObjType::Iterate\sfacility.\r\n\r\nAll\sthat\smakes\sdifficult\sto\simplement\sit\swith\sreasonable\sperformance\sfor\sall\scorner\scases.\sHowever\sI'll\stake\sa\scloser\slook\sto\sthis\slater.
J login sebres
J mimetype text/x-markdown
K 28cc67a606a7ab771af4c7b542b34ec1a377edc7
U sebres
Z 8c9bcf6a154fac9fc2c964fb675e082b