[Cuis-dev] Small dictionaries
Luciano Notarfrancesco
luchiano at gmail.com
Sun Jan 11 23:52:32 PST 2026
In the software I’m currently programming I’m using the events subsystem a
lot, and I’m subclassing from ActiveModel. Each model typically only
triggers 2-3 types of events, so the action dictionary is very small. And I
have another similar case with a small dictionary (also typically 2-3
entries, at most 5). Lookups and event triggering happen at about 300 Hz.
I’m wondering, wouldn’t be more efficient to just use arrays and a linear
lookup instead of dictionaries? Or, has anyone implemented dictionaries
optimized for a small number of entries? Any advice?
In general, I think we don’t have models that trigger many different types
of events, so it seems this optimization could be used in ActionModel. But
perhaps it hasnt been a priority to optimize this because we don’t usually
fire events at high rates, I guess.
Thanks,
Luciano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260112/cde2ced5/attachment.htm>
More information about the Cuis-dev
mailing list