Skip to content

Commit

Permalink
✨ New and improved benchmarks and extension points!
Browse files Browse the repository at this point in the history
— ✨ Pivot information added to most transcode points!
  • Loading branch information
ThePhD committed Sep 20, 2022
1 parent cd93367 commit 7fdc846
Show file tree
Hide file tree
Showing 78 changed files with 2,274 additions and 1,171 deletions.
37 changes: 21 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ cmake_policy(VERSION 3.21)
include(FetchContent)
FetchContent_Declare(ztd.cmake
GIT_REPOSITORY https://github.com/soasis/cmake
GIT_TAG main)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(ztd.cmake)
set(CMAKE_PROJECT_INCLUDE ${ZTD_CMAKE_PROJECT_PRELUDE})

Expand Down Expand Up @@ -118,32 +119,35 @@ option(ZTD_TEXT_DOCUMENTATION_NO_SPHINX "Turn off Sphinx usage (useful for ReadT
option(ZTD_TEXT_EXAMPLES "Enable build of examples" OFF)
option(ZTD_TEXT_BENCHMARKS "Enable build of benchmarks" OFF)
option(ZTD_TEXT_GENERATE_SINGLE "Enable generation of a single header and its target" OFF)
option(ZTD_TEXT_USE_CUNEICODE "Use ztd.cuneicode" OFF)

# # Dependencies
# ztd.idk
FetchContent_Declare(ztd.idk
GIT_REPOSITORY https://github.com/soasis/idk.git
GIT_TAG main)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(ztd.idk)

# ztd.static_containers
FetchContent_Declare(ztd.static_containers
GIT_REPOSITORY https://github.com/soasis/static_containers.git
GIT_TAG main)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(ztd.static_containers)

# ztd.cuneicode
set(ZTD_CUNEICODE_SIMDUTF_SHARED ${ZTD_TEXT_BENCHMARKS})
FetchContent_Declare(ztd.cuneicode
GIT_REPOSITORY https://github.com/soasis/cuneicode.git
GIT_TAG main)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(ztd.cuneicode)

# ztd.platform
FetchContent_Declare(ztd.platform
GIT_REPOSITORY https://github.com/soasis/platform.git
GIT_TAG main)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(ztd.platform)

if (ZTD_TEXT_BENCHAMRKS OR ZTD_TEXT_GENERATE_SINGLE OR ZTD_TEXT_DOCUMENTATION)
Expand Down Expand Up @@ -195,28 +199,29 @@ if (ZTD_TEXT_EXAMPLES OR ZTD_TEXT_BENCHMARKS)
# # Fetch dependencies for either benchmarks and/or examples
function(simdutf_dependency_jail)
# simdutf
set(SIMDUTF_BENCHMARKS OFF CACHE INTERNAL "")
set(BUILD_TESTING OFF CACHE INTERNAL "")
set(SIMDUTF_BENCHMARKS OFF)
set(BUILD_TESTING OFF)
FetchContent_Declare(
simdutf
GIT_REPOSITORY https://github.com/simdutf/simdutf
)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(simdutf)
endfunction()
simdutf_dependency_jail()

function(boost_text_dependency_jail)
# boost.text
set(BOOST_TEXT_PERF OFF CACHE INTERNAL "")
set(BOOST_TEXT_EXAMPLES OFF CACHE INTERNAL "")
set(BOOST_TEXT_TESTS OFF CACHE INTERNAL "")
set(BOOST_TEXT_FETCH_BOOST ON CACHE INTERNAL "")
set(BOOST_TEXT_INSTALL OFF CACHE INTERNAL "")
set(BUILD_TESTING OFF CACHE INTERNAL "")
set(BOOST_TEXT_PERF OFF)
set(BOOST_TEXT_EXAMPLES OFF)
set(BOOST_TEXT_TESTS OFF)
set(BOOST_TEXT_INSTALL OFF)
set(BUILD_TESTING OFF)
FetchContent_Declare(
boost.text
GIT_REPOSITORY https://github.com/ThePhD/text
)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(boost.text)
endfunction()
boost_text_dependency_jail()
Expand Down
27 changes: 14 additions & 13 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ function(googlebenchmark_dependency_jail)
FetchContent_Declare(
googlebenchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG 108ca84820dc932957b75e6b31faa6c3cf0aa37a
)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_GetProperties(googlebenchmark)

if(NOT googlebenchmark_POPULATED)
FetchContent_Populate(googlebenchmark)
set(BENCHMARK_ENABLE_INSTALL OFF CACHE INTERNAL "")
set(BENCHMARK_ENABLE_TESTING OFF CACHE INTERNAL "")
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE INTERNAL "")
set(BENCHMARK_ENABLE_WERROR OFF CACHE INTERNAL "")
set(BENCHMARK_FORCE_WERROR OFF CACHE INTERNAL "")
set(BENCHMARK_ENABLE_INSTALL OFF)
set(BENCHMARK_ENABLE_TESTING OFF)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
set(BENCHMARK_ENABLE_WERROR OFF)
set(BENCHMARK_FORCE_WERROR OFF)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND WIN32)
# google benchmark is broken, so we need to force HAVE_STD_REGEX to be on for this.
set(HAVE_STD_REGEX ON CACHE INTERNAL "")
set(HAVE_STD_REGEX ON)
endif()
add_subdirectory(${googlebenchmark_SOURCE_DIR} ${googlebenchmark_BINARY_DIR})
endif()
Expand All @@ -60,6 +60,7 @@ function (utf8cpp_dependency_jail)
FetchContent_Declare(
utf8cpp
GIT_REPOSITORY https://github.com/nemtrif/utfcpp
GIT_SHALLOW ON
)
FetchContent_MakeAvailable(utf8cpp)
endfunction()
Expand All @@ -69,8 +70,8 @@ function (ctre_dependency_jail)
FetchContent_Declare(
ctre
GIT_REPOSITORY https://github.com/hanickadot/compile-time-regular-expressions
GIT_TAG main
)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(ctre)
endfunction()
ctre_dependency_jail()
Expand All @@ -80,12 +81,12 @@ function(ztd_platform_dependency_jail)
FetchContent_Declare(
ztd.platform
GIT_REPOSITORY https://github.com/soasis/platform
GIT_TAG main
)
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(ztd.platform)
endfunction()
ztd_platform_dependency_jail()

add_subdirectory(barrier)
add_subdirectory(function_form)
add_subdirectory(speed)
add_subdirectory(conversion_speed)
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
# ============================================================================>

# # Benchmark Executable
file(GLOB_RECURSE ztd.text.benchmarks.speed.sources
file(GLOB_RECURSE ztd.text.benchmarks.conversion_speed.sources
CONFIGURE_DEPENDS
LIST_DIRECTORIES NO
source/**)

add_executable(ztd.text.benchmarks.speed ${ztd.text.benchmarks.speed.sources})
target_include_directories(ztd.text.benchmarks.speed
add_executable(ztd.text.benchmarks.conversion_speed ${ztd.text.benchmarks.conversion_speed.sources})
target_include_directories(ztd.text.benchmarks.conversion_speed
PRIVATE
include
)
target_link_libraries(ztd.text.benchmarks.speed
target_link_libraries(ztd.text.benchmarks.conversion_speed
PRIVATE
ztd::platform
ztd::cuneicode
Expand All @@ -53,7 +53,7 @@ target_link_libraries(ztd.text.benchmarks.speed
benchmark::benchmark
${CMAKE_DL_LIBS}
)
target_compile_options(ztd.text.benchmarks.speed
target_compile_options(ztd.text.benchmarks.conversion_speed
PRIVATE
${--utf8-literal-encoding}
${--utf8-source-encoding}
Expand All @@ -65,14 +65,14 @@ target_compile_options(ztd.text.benchmarks.speed
${--warn-errors}
${--allow-microsoft-enum-value}
)
generate_config_and_manifest_for(ztd.text.benchmarks.speed)
#generate_config_and_manifest_for(ztd.text.benchmarks.conversion_speed)
configure_graph_benchmark_targets(
NAME
speed
conversion_speed
CONFIG
"${CMAKE_CURRENT_SOURCE_DIR}/graph_config.json"
TARGETS
ztd.text.benchmarks.speed
ztd.text.benchmarks.conversion_speed
REPETITIONS
${ZTD_TEXT_BENCHMARKS_REPETITIONS}
)
Original file line number Diff line number Diff line change
Expand Up @@ -181,23 +181,28 @@
},
{
"name": "ztd.text",
"pattern": "_ztd_text$",
"pattern": "ztd_text$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function."
},
{
"name": "ztd.text (unbounded)",
"pattern": "_ztd_text_unbounded$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function."
"pattern": "ztd_text_unbounded$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function, with output bounds checking turned off."
},
{
"name": "ztd.text (single loop)",
"pattern": "_ztd_text_single$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function."
"pattern": "ztd_text_single$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode_one function."
},
{
"name": "ztd.text (single loop, unbounded)",
"pattern": "_ztd_text_single_unbounded$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function."
"pattern": "ztd_text_single_unbounded$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode_one function in a loop, with output bounds checking turned off."
},
{
"name": "ztd.text view",
"pattern": "ztd_text_view$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode_view range abstraction."
}
],
"data_labels": [
Expand Down

0 comments on commit 7fdc846

Please sign in to comment.