experiment with "inverting" liveness to improve perf of html5ever #52460
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
NLL-performant
Working towards the "performance is good" goal
Milestone
html5ever profiles are dominated by code that "applies" the result of computing liveness. In thinking over how this code works, it seems like it might be better to "invert". Currently what happens is this:
util/liveness
code computes, for each point in the CFG, the set of live variables at each pointYou can see here the mismatch: in the first case, we store a bitset of variables per point, and in the later, a bitset of points per region. This results in a lot of "conversion" instructions.
I was thinking that it might be more efficient to do the liveness in an inverted sense. Instead of re-using the
util/liveness
code, we would do the following:This isn't fundamentally different but it has a few potential advantages:
One complication I remember now is that for drop-live we also do need the results of initialization at each point. That could be a bit of a pain to reconcile, have to think about it.
All in all, not an easy change, but maybe a good one.
The text was updated successfully, but these errors were encountered: