Ability to recreate yoga trees from JSON captures (#1566)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1566 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 Reviewed By: NickGerleman Differential Revision: D52987588 fbshipit-source-id: 7f7c9ca9956f693be62bc5e3cebdf1aed6f58aec
This commit is contained in:
committed by
Facebook GitHub Bot
parent
efd27efd70
commit
0ca15bdaaa
@@ -3,7 +3,6 @@
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
|
||||
cmake_minimum_required(VERSION 3.13...3.26)
|
||||
project(benchmark)
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
@@ -13,7 +12,16 @@ include(${YOGA_ROOT}/cmake/project-defaults.cmake)
|
||||
|
||||
add_subdirectory(${YOGA_ROOT}/yoga ${CMAKE_CURRENT_BINARY_DIR}/yoga)
|
||||
|
||||
file(GLOB SOURCES CONFIGURE_DEPENDS
|
||||
file(GLOB SOURCES_LEGACY CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
||||
file(GLOB SOURCES CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
|
||||
add_executable(benchmark ${SOURCES})
|
||||
add_executable(benchmarklegacy ${SOURCES_LEGACY})
|
||||
|
||||
target_link_libraries(benchmark yogacore)
|
||||
target_link_libraries(benchmarklegacy yogacore)
|
||||
target_include_directories(benchmark
|
||||
PRIVATE
|
||||
$<BUILD_INTERFACE:${YOGA_ROOT}/lib>)
|
||||
|
Reference in New Issue
Block a user