Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b034999 authored by Greg Hackmann's avatar Greg Hackmann
Browse files

PaintMeasureTextTest: only pause/resume not_cached benchmarks



Pausing and resuming the benchmark timer isn't needed unless we plan to
flush the text layout cache.  The cached benchmark runs are so fast on
high-end devices, the overhead of these extra calls can be significant
compared to the actual code being measured.

Test: run PaintMeasureTextTest on sailfish

Bug: 69634871
Change-Id: If8246154e50451d82ac96e026036aa4a42eaed8d
Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
(cherry picked from commit ceb5dd0f)
parent d6ebb55c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -80,11 +80,11 @@ public class PaintMeasureTextTest {
        }

        while (state.keepRunning()) {
            state.pauseTiming();
            if (mCacheMode == DONT_USE_CACHE) {
                state.pauseTiming();
                Canvas.freeTextLayoutCaches();
            }
                state.resumeTiming();
            }

            paint.measureText(mText);
        }