• Vyacheslav Egorov's avatar
    Use persistent hash map to store _inheritedWidgets (#107068) · 81300293
    Vyacheslav Egorov authored
    * Use persistent hash map to store _inheritedWidgets
    
    Instead of using a HashMap and copying it down the tree
    which leads to quadratic time and space complexity
    use a persistent data structure which can amortize
    the cost by sharing parts of the structure.
    
    The data shows HAMT based PersistentHashMap to be
    5-10x faster for building _inheritedWidgets and
    considerably more space effecient (e.g. bringing
    amount of memory allocated when constructing
    _inheritedWidgets in a tree with 150 InheritedWidget
    down to 70Kb from 970Kb).
    
    PersistentHashMap is slower than HashMap for
    access: 2-3x in relative terms, but in absolute
    terms we are only talking about ~0.2ns slow down
    per access and various app benchmarks we run have
    have not revealed any significant regressions.
    81300293
Name
Last commit
Last update
..
README.md Loading commit data...
_bitfield_io.dart Loading commit data...
_bitfield_web.dart Loading commit data...
_isolates_io.dart Loading commit data...
_isolates_web.dart Loading commit data...
_platform_io.dart Loading commit data...
_platform_web.dart Loading commit data...
annotations.dart Loading commit data...
assertions.dart Loading commit data...
basic_types.dart Loading commit data...
binding.dart Loading commit data...
bitfield.dart Loading commit data...
change_notifier.dart Loading commit data...
collections.dart Loading commit data...
consolidate_response.dart Loading commit data...
constants.dart Loading commit data...
debug.dart Loading commit data...
diagnostics.dart Loading commit data...
isolates.dart Loading commit data...
key.dart Loading commit data...
licenses.dart Loading commit data...
math.dart Loading commit data...
node.dart Loading commit data...
object.dart Loading commit data...
observer_list.dart Loading commit data...
persistent_hash_map.dart Loading commit data...
platform.dart Loading commit data...
print.dart Loading commit data...
serialization.dart Loading commit data...
stack_frame.dart Loading commit data...
synchronous_future.dart Loading commit data...
unicode.dart Loading commit data...