You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the dict-primitives are not public available (for usage in module), I've simulated the smart dict reference with simple duplication (to guarantee single reference of the object, to get alterable dict collection).
This workaround has following consequences:
Certain objects "leakage", because each format-object (no matter localized format or not) will be stored in ::tcl::clock::LocaleFormats cache. This is very annoying especially if many dynamically formats are used;
Certain performance degradation (for above-mentioned reason with localization of each format and duplication instead of smart-ref);
Not optimal usage of internal cache structures by date-time conversion with fast switch of locale / formats;
also the internal GC for the formats is not really usable (because all objects are still referenced in LocaleFormats).
All that is a reason enough to re-implement a "technical" dict smart pointer in tclclockmod, similar to clock-speedup branch in the fossil-repo of tcl-core.
The code example to reproduce a "leak" using simple dynamic clock-format:
time {
clock format 0 -format "[expr {int(rand()*10000)}] %a %b, %x-%X"\
-locale [lindex {en de fr} [expr {int(rand()*3)}]]
} 100000
BTW. Please note that the amount of the "leakage" of default clock ensemble is many times larger in this case (because of the format-caching).
Engine
Memory usage (x86)
Memory usage (x64)
tcl8.6-clock
ca. 130MB
ca. 170MB
tclclockmod
ca. 20MB
ca. 50MB
But nevertheless I see the necessity to "fix" it in tclclockmod.
The text was updated successfully, but these errors were encountered:
Because the dict-primitives are not public available (for usage in module), I've simulated the smart dict reference with simple duplication (to guarantee single reference of the object, to get alterable dict collection).
This workaround has following consequences:
::tcl::clock::LocaleFormats
cache. This is very annoying especially if many dynamically formats are used;All that is a reason enough to re-implement a "technical" dict smart pointer in tclclockmod, similar to clock-speedup branch in the fossil-repo of tcl-core.
The code example to reproduce a "leak" using simple dynamic clock-format:
BTW. Please note that the amount of the "leakage" of default clock ensemble is many times larger in this case (because of the format-caching).
But nevertheless I see the necessity to "fix" it in tclclockmod.
The text was updated successfully, but these errors were encountered: