Artifacts Associated With Ticket 1552883
Ticket change [d5c9208109] (rid 123693) by dgp on 2006-09-05 18:15:28:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Want [dict] expertise to weigh in on this. Considering replacing: foreach {src dist} $pairs { dict set Msgs $locale $ns $src $dest } with: dict set Msgs $locale $ns \ [dict replace \ [dict get $Msgs $locale $ns] \ {expand}$pairs] Any advice on whether that should be expected to be an improvement? Any need for [K]? (Note that the use of {expand} will force direct evaluation - no bytecode) - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "30. msgcat Package"
- title initialized to: "msgcat [dict] usage"
- type initialized to: "RFE"
Ticket change [54c9d7b959] (rid 94009) by dkf on 2006-09-07 17:28:37:
- assignee changed to: "dgp"
- icomment:
Logged In: YES user_id=79902 Is loading a message catalog a bottleneck? If not, anything will do if it works. Another suggested version: dict update Msgs $locale locale { dict update locale $ns map { set map [dict replace $map {expand}$pairs] } } If performance is critical, measure the alternatives and use the best one ([dict replace] is not bytecode compiled anyway, and all other dict subcommands mentioned are.) - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [fa63d83e5b] (rid 91863) by dgp on 2006-09-08 02:48:09:
- closedate changed to: "2006-09-07T19:48:09"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Looking into this some more, it appears the original is really best. Whatever one might save pushing the [foreach] from Tcl into C, one is certain to lose in all the additional copying of shared Tcl_Obj's that [dict replace] and [dict update] will require. The original appears to do a true update in place.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dgp"
Ticket change [9be916befb] (rid 111199) by dkf on 2006-09-08 02:57:45:
- icomment:
Logged In: YES user_id=79902 While it is possible to do things to make the code more efficient (รก la [K]) I don't recommend it if there is no clear performance gain, as they are messy and surprisingly hard to maintain. Simple is Good!
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment: