MCPcopy Create free account
hub / github.com/Snapchat/Valdi / Destroy

Function Destroy

valdi/test/benchmark/runtime_benchmark.cpp:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21BENCHMARK(CreateRenderAndDestroy);
22
23static void Destroy(benchmark::State& state) {
24 RuntimeWrapper wrapper(false);
25 wrapper.logger.setMinLogType(Valdi::LogTypeWarn);
26 wrapper.flushQueues();
27
28 auto context = wrapper.runtime->createContext(STRING_LITERAL("test"), STRING_LITERAL("CSSBenchmark"), Value());
29 context->onCreate();
30
31 for (auto _ : state) {
32 state.PauseTiming();
33 auto tree = wrapper.runtime->createViewNodeTree(context);
34 wrapper.runtime->render(tree, nullptr);
35 state.ResumeTiming();
36 wrapper.runtime->destroyViewNodeTree(*tree);
37 }
38}
39BENCHMARK(Destroy);
40
41static void Render(benchmark::State& state) {

Callers

nothing calls this directly

Calls 8

setMinLogTypeMethod · 0.80
createViewNodeTreeMethod · 0.80
destroyViewNodeTreeMethod · 0.80
createContextMethod · 0.65
onCreateMethod · 0.65
renderMethod · 0.65
ValueInterface · 0.50
flushQueuesMethod · 0.45

Tested by

no test coverage detected