Commit 5b8e6a59 authored by David Brazdil's avatar David Brazdil
Browse files

ART: Cache last returned range in LiveInterval::Covers

Optimizing spends ~10% of compilation time in the register allocator.
One of the frequently called methods is LiveInterval::Covers which
has linear complexity w.r.t. the number of gaps in liveness intervals.
This patch leverages the fact that the register allocator calls Covers
with non-decreasing position values and caches the last returned
result to start the iteration closer to the result the next time the
method is invoked. Stats from compiling the framework show that this
optimization reduces the average number of iterations needed to find
the result by 40%.

Change-Id: I4dd26b900879d5e1d03818ebc1e117cc6a53053c
parent 2eb5168b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment