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

Function CreateRenderAndDestroy

valdi/test/benchmark/runtime_benchmark.cpp:7–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace ValdiTest;
6
7static void CreateRenderAndDestroy(benchmark::State& state) {
8 RuntimeWrapper wrapper(false);
9 wrapper.logger.setMinLogType(Valdi::LogTypeWarn);
10 wrapper.flushQueues();
11
12 auto context = wrapper.runtime->createContext(STRING_LITERAL("test"), STRING_LITERAL("CSSBenchmark"), Value());
13 context->onCreate();
14
15 for (auto _ : state) {
16 auto tree = wrapper.runtime->createViewNodeTree(context);
17 wrapper.runtime->render(tree, nullptr);
18 wrapper.runtime->destroyViewNodeTree(*tree);
19 }
20}
21BENCHMARK(CreateRenderAndDestroy);
22
23static void Destroy(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