dart-archive / dump-info-visualizer

A visualizer for the JSON data produced by the dart2js --dump-info command
https://dart-lang.github.io/dump-info-visualizer
BSD 3-Clause "New" or "Revised" License
42 stars 15 forks source link

Trivially Retained Size #23

Closed TyOverby closed 10 years ago

TyOverby commented 10 years ago

Write a function to compute the trivially retained size of a function

trivially_retained(node):
    queue = [node]
    owned  = {node}

    for n in queue:
        for c in n.children:
            if (c.parents are all contained in owned) and (c is not in owned):
                owned.add(c)
                queue.add(c)
TyOverby commented 10 years ago

Implemented in 7f8f39669c676ffa3932f9d16e6171170c286750