Skip to content

Commit

Permalink
Revert "[DisplayList] Allow random access to ops through indexing" (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
bdero authored Aug 20, 2024
1 parent 5cbf96d commit a6508d6
Show file tree
Hide file tree
Showing 8 changed files with 463 additions and 1,355 deletions.
94 changes: 0 additions & 94 deletions display_list/benchmarking/dl_builder_benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,60 +220,6 @@ static void BM_DisplayListDispatchDefault(
}
}

static void BM_DisplayListDispatchByIndexDefault(
benchmark::State& state,
DisplayListDispatchBenchmarkType type) {
bool prepare_rtree = NeedPrepareRTree(type);
DisplayListBuilder builder(prepare_rtree);
for (int i = 0; i < 5; i++) {
InvokeAllOps(builder);
}
auto display_list = builder.Build();
DlOpReceiverIgnore receiver;
while (state.KeepRunning()) {
DlIndex end = display_list->GetRecordCount();
for (DlIndex i = 0u; i < end; i++) {
display_list->Dispatch(receiver, i);
}
}
}

static void BM_DisplayListDispatchByIteratorDefault(
benchmark::State& state,
DisplayListDispatchBenchmarkType type) {
bool prepare_rtree = NeedPrepareRTree(type);
DisplayListBuilder builder(prepare_rtree);
for (int i = 0; i < 5; i++) {
InvokeAllOps(builder);
}
auto display_list = builder.Build();
DlOpReceiverIgnore receiver;
while (state.KeepRunning()) {
for (DlIndex i : *display_list) {
display_list->Dispatch(receiver, i);
}
}
}

static void BM_DisplayListDispatchByVectorDefault(
benchmark::State& state,
DisplayListDispatchBenchmarkType type) {
bool prepare_rtree = NeedPrepareRTree(type);
DisplayListBuilder builder(prepare_rtree);
for (int i = 0; i < 5; i++) {
InvokeAllOps(builder);
}
auto display_list = builder.Build();
DlOpReceiverIgnore receiver;
while (state.KeepRunning()) {
std::vector<DlIndex> indices =
display_list->GetCulledIndices(display_list->bounds());
for (DlIndex index : indices) {
display_list->Dispatch(receiver, index);
}
}
}

static void BM_DisplayListDispatchCull(benchmark::State& state,
DisplayListDispatchBenchmarkType type) {
bool prepare_rtree = NeedPrepareRTree(type);
Expand All @@ -290,26 +236,6 @@ static void BM_DisplayListDispatchCull(benchmark::State& state,
}
}

static void BM_DisplayListDispatchByVectorCull(
benchmark::State& state,
DisplayListDispatchBenchmarkType type) {
bool prepare_rtree = NeedPrepareRTree(type);
DisplayListBuilder builder(prepare_rtree);
for (int i = 0; i < 5; i++) {
InvokeAllOps(builder);
}
auto display_list = builder.Build();
SkRect rect = SkRect::MakeLTRB(0, 0, 100, 100);
EXPECT_FALSE(rect.contains(display_list->bounds()));
DlOpReceiverIgnore receiver;
while (state.KeepRunning()) {
std::vector<DlIndex> indices = display_list->GetCulledIndices(rect);
for (DlIndex index : indices) {
display_list->Dispatch(receiver, index);
}
}
}

BENCHMARK_CAPTURE(BM_DisplayListBuilderDefault,
kDefault,
DisplayListBuilderBenchmarkType::kDefault)
Expand Down Expand Up @@ -444,24 +370,4 @@ BENCHMARK_CAPTURE(BM_DisplayListDispatchCull,
DisplayListDispatchBenchmarkType::kCulledWithRtree)
->Unit(benchmark::kMicrosecond);

BENCHMARK_CAPTURE(BM_DisplayListDispatchByIndexDefault,
kDefaultNoRtree,
DisplayListDispatchBenchmarkType::kDefaultNoRtree)
->Unit(benchmark::kMicrosecond);

BENCHMARK_CAPTURE(BM_DisplayListDispatchByIteratorDefault,
kDefaultNoRtree,
DisplayListDispatchBenchmarkType::kDefaultNoRtree)
->Unit(benchmark::kMicrosecond);

BENCHMARK_CAPTURE(BM_DisplayListDispatchByVectorDefault,
kDefaultNoRtree,
DisplayListDispatchBenchmarkType::kDefaultNoRtree)
->Unit(benchmark::kMicrosecond);

BENCHMARK_CAPTURE(BM_DisplayListDispatchByVectorCull,
kCulledWithRtree,
DisplayListDispatchBenchmarkType::kCulledWithRtree)
->Unit(benchmark::kMicrosecond);

} // namespace flutter
Loading

0 comments on commit a6508d6

Please sign in to comment.