Summary: In the previous diffs we serialized the in-memory representation of a node into json. This diff exposes a `generateBenchmark` method that reads from that json executes the proper public Yoga API functions to recreate the same tree. It then calls calculate layout so that we can time that in the next diff. This diff is really only focusing on the core aspects of a yoga tree like style, children, and calculating layout; there are still more things to add coming up: * Support for configs, experiments, and errata * Support for measure functions * Support for general node state that is not style (like always forming a containing block) * Actually running all of these benchmarks together * Tests Differential Revision: D52987588
22 lines
425 B
C++
22 lines
425 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#ifdef DEBUG
|
|
|
|
#pragma once
|
|
|
|
#include <yoga/node/Node.h>
|
|
|
|
namespace facebook::yoga {
|
|
|
|
void captureTree(const Node* node, std::string captureName);
|
|
|
|
void generateBenchmark(std::string captureName);
|
|
|
|
} // namespace facebook::yoga
|
|
#endif
|