Artifacts Associated With Ticket 236d18f49b
Ticket change [a6e5e4c802] (rid 238979) by jan.nijtmans on 2025-04-11 10:32:40:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
The function Tcl_FindHashEntry() is implemented like: <pre> #define Tcl_FindHashEntry(tablePtr, key) \ (*((tablePtr)->findProc))(tablePtr, (const char *)(key)) </pre> while the findProc is implemented as: <pre> static Tcl_HashEntry * FindHashEntry( Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */ const char *key) /* Key to use to find matching entry. */ { return CreateHashEntry(tablePtr, key, NULL); } </pre> This means we can do better. Why not just call the createProc directly with it's last NULL parameter (which means don't create anything) This also means that findProc is not used any more, and could be removed altogether. Only .. we cannot remove it yet, because it might be used by Tcl 9.0-compiled extensions. Since the Tcl_HashTable content is not documented, this is 100% upwards and downwards compatible. - foundin initialized to: "9.1"
- is_private initialized to: "0"
- login: "jan.nijtmans"
- priority initialized to: "5 Medium"
- private_contact initialized to: "0c50e5320704d174412e57b873d8932de15303e0"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "jan.nijtmans"
- subsystem initialized to: "69. Other"
- title initialized to: "More efficient Tcl_FindHashEntry()"
- type initialized to: "Patch"
Ticket change [d12628950d] (rid 239011) by apnadkarni on 2025-04-12 03:17:49:
- icomment:
Will this patch not preclude possible future internal implementation changes where find is no longer implemented through create? Looking at [generated code](https://godbolt.org/z/6s58TeaWG), it saves one jump. Not sure it is worth precluding future changes, however unlikely they might be. IMO.
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [4964500130] (rid 239093) by jan.nijtmans on 2025-04-13 22:27:59:
- assignee changed to: "jan.nijtmans"
- icomment:
Implementation is complete now. My goal was two things: - Allow the newPtr value to be NULL, meaning "I'm not interested in this" - Implement Tcl_AttemptCreateHashEntry() (in a separate branch) The second addition means that a TIP needs to be written anyway, so I an put this improvement in it as well.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"