Optimize data structures in context_bridge::ObjectCache
perf: optimize data structures in context_bridge::ObjectCache (#27639)
Optimize data structures in context_bridge::ObjectCacheperfoptimize data structures context bridge objectcache
Committed by MarshallOfSound
commit message
perf: optimize data structures in context_bridge::ObjectCache (#27639)
* Use std::forward_list instead of base::LinkedList for better perf,
more consistent memory management. Better than std::list because we
don't need the double-linked-list behavior of std::list
* Use std::unordered_map instead of std::map for the v8 hash tableEditor assessment
The subject states the target and intent: data structures optimized in context_bridge ObjectCache. The perf type is exactly right. The body is genuinely instructive: forward_list replaces base LinkedList for steadier memory management and because the double-linked behavior was unused, and an unordered_map replaces map for the v8 hash table, with the reasoning for each substitution stated. That is trade-off analysis, not patch notes. The PR reference is well-formed and hygiene is clean. An exemplar-level message that teaches why each structure was chosen.