data-structure-typed 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/CMakeLists.txt +52 -0
- package/README.md +4 -4
- package/README_CN.md +5 -5
- package/benchmark/report.html +141 -12
- package/benchmark/report.json +1969 -38
- package/build/CMakeCache.txt +603 -0
- package/build/CMakeFiles/4.0.3/CMakeCXXCompiler.cmake +104 -0
- package/build/CMakeFiles/4.0.3/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/build/CMakeFiles/4.0.3/CMakeSystem.cmake +15 -0
- package/build/CMakeFiles/4.0.3/CompilerIdCXX/CMakeCXXCompilerId.cpp +920 -0
- package/build/CMakeFiles/4.0.3/CompilerIdCXX/a.out +0 -0
- package/build/CMakeFiles/4.0.3/CompilerIdCXX/apple-sdk.cpp +1 -0
- package/build/CMakeFiles/CMakeConfigureLog.yaml +2146 -0
- package/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- package/build/CMakeFiles/InstallScripts.json +9 -0
- package/build/CMakeFiles/Makefile.cmake +100 -0
- package/build/CMakeFiles/Makefile2 +720 -0
- package/build/CMakeFiles/TargetDirectories.txt +23 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp.o +0 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp.o.d +835 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/test/performance/data-structures/binary-tree/avl-tree.test.cpp.o +0 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/test/performance/data-structures/binary-tree/avl-tree.test.cpp.o.d +835 -0
- package/build/CMakeFiles/cmake.check_cache +1 -0
- package/build/CMakeFiles/deque-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/deque-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/deque-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.internal +791 -0
- package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.make +2362 -0
- package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/deque-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/deque-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/deque-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/deque-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/deque-benchmark.dir/test/performance/data-structures/queue/deque.test.cpp.o +0 -0
- package/build/CMakeFiles/deque-benchmark.dir/test/performance/data-structures/queue/deque.test.cpp.o.d +787 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.internal +790 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.make +2359 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp.o +0 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp.o.d +786 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.internal +790 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.make +2359 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/test/performance/data-structures/hash/hash-map.test.cpp.o +0 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/test/performance/data-structures/hash/hash-map.test.cpp.o.d +786 -0
- package/build/CMakeFiles/heap-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/heap-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/heap-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.internal +843 -0
- package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.make +2518 -0
- package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/heap-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/heap-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/heap-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/heap-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/heap-benchmark.dir/test/performance/data-structures/heap/heap.test.cpp.o +0 -0
- package/build/CMakeFiles/heap-benchmark.dir/test/performance/data-structures/heap/heap.test.cpp.o.d +839 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.internal +793 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.make +2368 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/test/performance/data-structures/priority-queue/priority-queue.test.cpp.o +0 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/test/performance/data-structures/priority-queue/priority-queue.test.cpp.o.d +789 -0
- package/build/CMakeFiles/progress.marks +1 -0
- package/build/CMakeFiles/queue-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/queue-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/queue-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.internal +793 -0
- package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.make +2368 -0
- package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/queue-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/queue-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/queue-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/queue-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/queue-benchmark.dir/test/performance/data-structures/queue/queue.test.cpp.o +0 -0
- package/build/CMakeFiles/queue-benchmark.dir/test/performance/data-structures/queue/queue.test.cpp.o.d +789 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/test/performance/data-structures/binary-tree/red-black-tree.test.cpp.o +0 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/test/performance/data-structures/binary-tree/red-black-tree.test.cpp.o.d +835 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.internal +790 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.make +2359 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/singly-linked-list.test.cpp.o +0 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/singly-linked-list.test.cpp.o.d +786 -0
- package/build/CMakeFiles/stack-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/stack-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/stack-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.internal +793 -0
- package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.make +2368 -0
- package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/stack-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/stack-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/stack-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/stack-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/stack-benchmark.dir/test/performance/data-structures/stack/stack.test.cpp.o +0 -0
- package/build/CMakeFiles/stack-benchmark.dir/test/performance/data-structures/stack/stack.test.cpp.o.d +789 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-map.test.cpp.o +0 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-map.test.cpp.o.d +835 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp.o +0 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp.o.d +835 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp.o +0 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp.o.d +835 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-set.test.cpp.o +0 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-set.test.cpp.o.d +835 -0
- package/build/Makefile +783 -0
- package/build/_deps/benchmark-build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- package/build/_deps/benchmark-build/CMakeFiles/progress.marks +1 -0
- package/build/_deps/benchmark-build/Makefile +140 -0
- package/build/_deps/benchmark-build/benchmark.pc +12 -0
- package/build/_deps/benchmark-build/benchmarkConfig.cmake +14 -0
- package/build/_deps/benchmark-build/benchmarkConfigVersion.cmake +65 -0
- package/build/_deps/benchmark-build/benchmarkTargets.cmake +84 -0
- package/build/_deps/benchmark-build/cmake_install.cmake +50 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/DependInfo.cmake +41 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o.d +875 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o.d +802 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_name.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_name.cc.o.d +772 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o.d +841 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o.d +833 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/build.make +402 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/check.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/check.cc.o.d +784 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/cmake_clean.cmake +47 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/cmake_clean_target.cmake +3 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/colorprint.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/colorprint.cc.o.d +791 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/commandlineflags.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/commandlineflags.cc.o.d +795 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.internal +15519 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.make +17500 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.ts +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/complexity.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/complexity.cc.o.d +793 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/console_reporter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/console_reporter.cc.o.d +802 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/counter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/counter.cc.o.d +773 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/csv_reporter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/csv_reporter.cc.o.d +799 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/depend.make +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/flags.make +10 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/json_reporter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/json_reporter.cc.o.d +800 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/link.txt +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/perf_counters.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/perf_counters.cc.o.d +807 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/progress.make +21 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/reporter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/reporter.cc.o.d +798 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/statistics.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/statistics.cc.o.d +800 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/string_util.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/string_util.cc.o.d +795 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/sysinfo.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/sysinfo.cc.o.d +933 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/timers.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/timers.cc.o.d +904 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/DependInfo.cmake +23 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o.d +772 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/build.make +114 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/cmake_clean.cmake +11 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/cmake_clean_target.cmake +3 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.internal +776 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.make +2317 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.ts +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/depend.make +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/flags.make +10 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/link.txt +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/progress.make +3 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/progress.marks +1 -0
- package/build/_deps/benchmark-build/src/Makefile +710 -0
- package/build/_deps/benchmark-build/src/cmake_install.cmake +45 -0
- package/build/_deps/benchmark-build/src/libbenchmark.a +0 -0
- package/build/_deps/benchmark-build/src/libbenchmark_main.a +0 -0
- package/build/_deps/benchmark-src/.clang-format +5 -0
- package/build/_deps/benchmark-src/.clang-tidy +7 -0
- package/build/_deps/benchmark-src/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- package/build/_deps/benchmark-src/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/build/_deps/benchmark-src/.github/install_bazel.sh +13 -0
- package/build/_deps/benchmark-src/.github/libcxx-setup.sh +26 -0
- package/build/_deps/benchmark-src/.github/workflows/bazel.yml +35 -0
- package/build/_deps/benchmark-src/.github/workflows/build-and-test-min-cmake.yml +46 -0
- package/build/_deps/benchmark-src/.github/workflows/build-and-test-perfcounters.yml +51 -0
- package/build/_deps/benchmark-src/.github/workflows/build-and-test.yml +114 -0
- package/build/_deps/benchmark-src/.github/workflows/clang-format-lint.yml +17 -0
- package/build/_deps/benchmark-src/.github/workflows/clang-tidy.yml +38 -0
- package/build/_deps/benchmark-src/.github/workflows/doxygen.yml +28 -0
- package/build/_deps/benchmark-src/.github/workflows/pylint.yml +28 -0
- package/build/_deps/benchmark-src/.github/workflows/sanitizer.yml +96 -0
- package/build/_deps/benchmark-src/.github/workflows/test_bindings.yml +29 -0
- package/build/_deps/benchmark-src/.github/workflows/wheels.yml +79 -0
- package/build/_deps/benchmark-src/.travis.yml +208 -0
- package/build/_deps/benchmark-src/.ycm_extra_conf.py +115 -0
- package/build/_deps/benchmark-src/AUTHORS +71 -0
- package/build/_deps/benchmark-src/BUILD.bazel +87 -0
- package/build/_deps/benchmark-src/CMakeLists.txt +340 -0
- package/build/_deps/benchmark-src/CONTRIBUTING.md +58 -0
- package/build/_deps/benchmark-src/CONTRIBUTORS +95 -0
- package/build/_deps/benchmark-src/LICENSE +202 -0
- package/build/_deps/benchmark-src/MODULE.bazel +24 -0
- package/build/_deps/benchmark-src/README.md +223 -0
- package/build/_deps/benchmark-src/WORKSPACE +22 -0
- package/build/_deps/benchmark-src/WORKSPACE.bzlmod +2 -0
- package/build/_deps/benchmark-src/_config.yml +2 -0
- package/build/_deps/benchmark-src/appveyor.yml +50 -0
- package/build/_deps/benchmark-src/bazel/benchmark_deps.bzl +65 -0
- package/build/_deps/benchmark-src/bindings/python/BUILD +3 -0
- package/build/_deps/benchmark-src/bindings/python/build_defs.bzl +25 -0
- package/build/_deps/benchmark-src/bindings/python/google_benchmark/BUILD +40 -0
- package/build/_deps/benchmark-src/bindings/python/google_benchmark/__init__.py +162 -0
- package/build/_deps/benchmark-src/bindings/python/google_benchmark/benchmark.cc +184 -0
- package/build/_deps/benchmark-src/bindings/python/google_benchmark/example.py +136 -0
- package/build/_deps/benchmark-src/bindings/python/nanobind.BUILD +17 -0
- package/build/_deps/benchmark-src/bindings/python/python_headers.BUILD +6 -0
- package/build/_deps/benchmark-src/cmake/AddCXXCompilerFlag.cmake +78 -0
- package/build/_deps/benchmark-src/cmake/CXXFeatureCheck.cmake +82 -0
- package/build/_deps/benchmark-src/cmake/Config.cmake.in +7 -0
- package/build/_deps/benchmark-src/cmake/GetGitVersion.cmake +58 -0
- package/build/_deps/benchmark-src/cmake/GoogleTest.cmake +58 -0
- package/build/_deps/benchmark-src/cmake/GoogleTest.cmake.in +59 -0
- package/build/_deps/benchmark-src/cmake/benchmark.pc.in +12 -0
- package/build/_deps/benchmark-src/cmake/gnu_posix_regex.cpp +12 -0
- package/build/_deps/benchmark-src/cmake/llvm-toolchain.cmake +8 -0
- package/build/_deps/benchmark-src/cmake/posix_regex.cpp +14 -0
- package/build/_deps/benchmark-src/cmake/pthread_affinity.cpp +16 -0
- package/build/_deps/benchmark-src/cmake/split_list.cmake +3 -0
- package/build/_deps/benchmark-src/cmake/std_regex.cpp +10 -0
- package/build/_deps/benchmark-src/cmake/steady_clock.cpp +7 -0
- package/build/_deps/benchmark-src/cmake/thread_safety_attributes.cpp +4 -0
- package/build/_deps/benchmark-src/docs/AssemblyTests.md +149 -0
- package/build/_deps/benchmark-src/docs/_config.yml +3 -0
- package/build/_deps/benchmark-src/docs/assets/images/icon.png +0 -0
- package/build/_deps/benchmark-src/docs/assets/images/icon.xcf +0 -0
- package/build/_deps/benchmark-src/docs/assets/images/icon_black.png +0 -0
- package/build/_deps/benchmark-src/docs/assets/images/icon_black.xcf +0 -0
- package/build/_deps/benchmark-src/docs/dependencies.md +13 -0
- package/build/_deps/benchmark-src/docs/index.md +12 -0
- package/build/_deps/benchmark-src/docs/perf_counters.md +35 -0
- package/build/_deps/benchmark-src/docs/platform_specific_build_instructions.md +48 -0
- package/build/_deps/benchmark-src/docs/python_bindings.md +34 -0
- package/build/_deps/benchmark-src/docs/random_interleaving.md +13 -0
- package/build/_deps/benchmark-src/docs/reducing_variance.md +100 -0
- package/build/_deps/benchmark-src/docs/releasing.md +41 -0
- package/build/_deps/benchmark-src/docs/tools.md +343 -0
- package/build/_deps/benchmark-src/docs/user_guide.md +1266 -0
- package/build/_deps/benchmark-src/include/benchmark/benchmark.h +1991 -0
- package/build/_deps/benchmark-src/include/benchmark/export.h +47 -0
- package/build/_deps/benchmark-src/pyproject.toml +50 -0
- package/build/_deps/benchmark-src/setup.py +113 -0
- package/build/_deps/benchmark-src/src/CMakeLists.txt +170 -0
- package/build/_deps/benchmark-src/src/arraysize.h +33 -0
- package/build/_deps/benchmark-src/src/benchmark.cc +779 -0
- package/build/_deps/benchmark-src/src/benchmark_api_internal.cc +118 -0
- package/build/_deps/benchmark-src/src/benchmark_api_internal.h +87 -0
- package/build/_deps/benchmark-src/src/benchmark_main.cc +18 -0
- package/build/_deps/benchmark-src/src/benchmark_name.cc +59 -0
- package/build/_deps/benchmark-src/src/benchmark_register.cc +520 -0
- package/build/_deps/benchmark-src/src/benchmark_register.h +109 -0
- package/build/_deps/benchmark-src/src/benchmark_runner.cc +497 -0
- package/build/_deps/benchmark-src/src/benchmark_runner.h +131 -0
- package/build/_deps/benchmark-src/src/check.cc +11 -0
- package/build/_deps/benchmark-src/src/check.h +106 -0
- package/build/_deps/benchmark-src/src/colorprint.cc +200 -0
- package/build/_deps/benchmark-src/src/colorprint.h +33 -0
- package/build/_deps/benchmark-src/src/commandlineflags.cc +298 -0
- package/build/_deps/benchmark-src/src/commandlineflags.h +133 -0
- package/build/_deps/benchmark-src/src/complexity.cc +244 -0
- package/build/_deps/benchmark-src/src/complexity.h +55 -0
- package/build/_deps/benchmark-src/src/console_reporter.cc +206 -0
- package/build/_deps/benchmark-src/src/counter.cc +80 -0
- package/build/_deps/benchmark-src/src/counter.h +32 -0
- package/build/_deps/benchmark-src/src/csv_reporter.cc +161 -0
- package/build/_deps/benchmark-src/src/cycleclock.h +230 -0
- package/build/_deps/benchmark-src/src/internal_macros.h +115 -0
- package/build/_deps/benchmark-src/src/json_reporter.cc +320 -0
- package/build/_deps/benchmark-src/src/log.h +88 -0
- package/build/_deps/benchmark-src/src/mutex.h +155 -0
- package/build/_deps/benchmark-src/src/perf_counters.cc +282 -0
- package/build/_deps/benchmark-src/src/perf_counters.h +200 -0
- package/build/_deps/benchmark-src/src/re.h +158 -0
- package/build/_deps/benchmark-src/src/reporter.cc +118 -0
- package/build/_deps/benchmark-src/src/statistics.cc +209 -0
- package/build/_deps/benchmark-src/src/statistics.h +44 -0
- package/build/_deps/benchmark-src/src/string_util.cc +254 -0
- package/build/_deps/benchmark-src/src/string_util.h +70 -0
- package/build/_deps/benchmark-src/src/sysinfo.cc +855 -0
- package/build/_deps/benchmark-src/src/thread_manager.h +63 -0
- package/build/_deps/benchmark-src/src/thread_timer.h +86 -0
- package/build/_deps/benchmark-src/src/timers.cc +272 -0
- package/build/_deps/benchmark-src/src/timers.h +48 -0
- package/build/_deps/benchmark-src/test/AssemblyTests.cmake +67 -0
- package/build/_deps/benchmark-src/test/BUILD +127 -0
- package/build/_deps/benchmark-src/test/CMakeLists.txt +309 -0
- package/build/_deps/benchmark-src/test/args_product_test.cc +77 -0
- package/build/_deps/benchmark-src/test/basic_test.cc +180 -0
- package/build/_deps/benchmark-src/test/benchmark_gtest.cc +169 -0
- package/build/_deps/benchmark-src/test/benchmark_min_time_flag_iters_test.cc +66 -0
- package/build/_deps/benchmark-src/test/benchmark_min_time_flag_time_test.cc +90 -0
- package/build/_deps/benchmark-src/test/benchmark_name_gtest.cc +82 -0
- package/build/_deps/benchmark-src/test/benchmark_random_interleaving_gtest.cc +126 -0
- package/build/_deps/benchmark-src/test/benchmark_setup_teardown_test.cc +157 -0
- package/build/_deps/benchmark-src/test/benchmark_test.cc +274 -0
- package/build/_deps/benchmark-src/test/clobber_memory_assembly_test.cc +64 -0
- package/build/_deps/benchmark-src/test/commandlineflags_gtest.cc +228 -0
- package/build/_deps/benchmark-src/test/complexity_test.cc +228 -0
- package/build/_deps/benchmark-src/test/cxx03_test.cc +62 -0
- package/build/_deps/benchmark-src/test/diagnostics_test.cc +91 -0
- package/build/_deps/benchmark-src/test/display_aggregates_only_test.cc +45 -0
- package/build/_deps/benchmark-src/test/donotoptimize_assembly_test.cc +201 -0
- package/build/_deps/benchmark-src/test/donotoptimize_test.cc +69 -0
- package/build/_deps/benchmark-src/test/filter_test.cc +117 -0
- package/build/_deps/benchmark-src/test/fixture_test.cc +51 -0
- package/build/_deps/benchmark-src/test/internal_threading_test.cc +185 -0
- package/build/_deps/benchmark-src/test/link_main_test.cc +9 -0
- package/build/_deps/benchmark-src/test/map_test.cc +59 -0
- package/build/_deps/benchmark-src/test/memory_manager_test.cc +47 -0
- package/build/_deps/benchmark-src/test/min_time_parse_gtest.cc +30 -0
- package/build/_deps/benchmark-src/test/multiple_ranges_test.cc +96 -0
- package/build/_deps/benchmark-src/test/options_test.cc +77 -0
- package/build/_deps/benchmark-src/test/output_test.h +211 -0
- package/build/_deps/benchmark-src/test/output_test_helper.cc +519 -0
- package/build/_deps/benchmark-src/test/perf_counters_gtest.cc +307 -0
- package/build/_deps/benchmark-src/test/perf_counters_test.cc +92 -0
- package/build/_deps/benchmark-src/test/register_benchmark_test.cc +196 -0
- package/build/_deps/benchmark-src/test/repetitions_test.cc +214 -0
- package/build/_deps/benchmark-src/test/report_aggregates_only_test.cc +41 -0
- package/build/_deps/benchmark-src/test/reporter_output_test.cc +1130 -0
- package/build/_deps/benchmark-src/test/skip_with_error_test.cc +199 -0
- package/build/_deps/benchmark-src/test/spec_arg_test.cc +105 -0
- package/build/_deps/benchmark-src/test/spec_arg_verbosity_test.cc +43 -0
- package/build/_deps/benchmark-src/test/state_assembly_test.cc +68 -0
- package/build/_deps/benchmark-src/test/statistics_gtest.cc +35 -0
- package/build/_deps/benchmark-src/test/string_util_gtest.cc +199 -0
- package/build/_deps/benchmark-src/test/templated_fixture_test.cc +28 -0
- package/build/_deps/benchmark-src/test/time_unit_gtest.cc +37 -0
- package/build/_deps/benchmark-src/test/user_counters_tabular_test.cc +558 -0
- package/build/_deps/benchmark-src/test/user_counters_test.cc +561 -0
- package/build/_deps/benchmark-src/test/user_counters_thousands_test.cc +186 -0
- package/build/_deps/benchmark-src/tools/BUILD.bazel +19 -0
- package/build/_deps/benchmark-src/tools/compare.py +432 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test1_run1.json +127 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test1_run2.json +127 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test2_run.json +81 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test3_run0.json +65 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test3_run1.json +65 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run.json +96 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run0.json +21 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run1.json +21 -0
- package/build/_deps/benchmark-src/tools/gbench/__init__.py +8 -0
- package/build/_deps/benchmark-src/tools/gbench/report.py +1201 -0
- package/build/_deps/benchmark-src/tools/gbench/util.py +203 -0
- package/build/_deps/benchmark-src/tools/libpfm.BUILD.bazel +22 -0
- package/build/_deps/benchmark-src/tools/requirements.txt +2 -0
- package/build/_deps/benchmark-src/tools/strip_asm.py +151 -0
- package/build/_deps/benchmark-subbuild/CMakeCache.txt +133 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/4.0.3/CMakeSystem.cmake +15 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeConfigureLog.yaml +11 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeRuleHashes.txt +11 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/InstallScripts.json +7 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/Makefile.cmake +52 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/Makefile2 +122 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/TargetDirectories.txt +3 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/DependInfo.cmake +22 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/Labels.json +46 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/Labels.txt +14 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/build.make +162 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/cmake_clean.cmake +17 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/compiler_depend.make +2 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/compiler_depend.ts +2 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/progress.make +10 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/cmake.check_cache +1 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/progress.marks +1 -0
- package/build/_deps/benchmark-subbuild/CMakeLists.txt +42 -0
- package/build/_deps/benchmark-subbuild/Makefile +162 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-gitclone-lastrun.txt +15 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-gitinfo.txt +15 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-patch-info.txt +6 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-update-info.txt +7 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-cfgcmd.txt +1 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-gitclone.cmake +87 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-gitupdate.cmake +317 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-mkdirs.cmake +27 -0
- package/build/_deps/benchmark-subbuild/cmake_install.cmake +56 -0
- package/build/bin/avl-rb-range-search-benchmark +0 -0
- package/build/bin/avl-tree-benchmark +0 -0
- package/build/bin/deque-benchmark +0 -0
- package/build/bin/doubly-linked-list-benchmark +0 -0
- package/build/bin/hash-map-benchmark +0 -0
- package/build/bin/heap-benchmark +0 -0
- package/build/bin/priority-queue-benchmark +0 -0
- package/build/bin/queue-benchmark +0 -0
- package/build/bin/red-black-tree-benchmark +0 -0
- package/build/bin/singly-linked-list-benchmark +0 -0
- package/build/bin/stack-benchmark +0 -0
- package/build/bin/tree-map-benchmark +0 -0
- package/build/bin/tree-multi-map-benchmark +0 -0
- package/build/bin/tree-multi-set-benchmark +0 -0
- package/build/bin/tree-set-benchmark +0 -0
- package/build/cmake_install.cmake +66 -0
- package/dist/cjs/index.cjs +1270 -1201
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +1309 -1210
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1268 -1196
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +1307 -1205
- package/dist/esm-legacy/index.mjs.map +1 -1
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/index.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +177 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +230 -147
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +263 -0
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +170 -0
- package/dist/types/interfaces/binary-tree.d.ts +1 -1
- package/dist/types/types/data-structures/binary-tree/index.d.ts +3 -3
- package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +28 -0
- package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +11 -0
- package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +28 -0
- package/dist/umd/data-structure-typed.js +1303 -1194
- package/dist/umd/data-structure-typed.js.map +1 -1
- package/dist/umd/data-structure-typed.min.js +10 -3
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/eslint.config.mjs +5 -1
- package/package.json +4 -3
- package/src/data-structures/binary-tree/avl-tree.ts +1 -1
- package/src/data-structures/binary-tree/binary-tree.ts +40 -16
- package/src/data-structures/binary-tree/bst.ts +6 -6
- package/src/data-structures/binary-tree/index.ts +3 -3
- package/src/data-structures/binary-tree/red-black-tree.ts +34 -52
- package/src/data-structures/binary-tree/tree-map.ts +417 -0
- package/src/data-structures/binary-tree/tree-multi-map.ts +467 -325
- package/src/data-structures/binary-tree/tree-multi-set.ts +491 -0
- package/src/data-structures/binary-tree/tree-set.ts +394 -0
- package/src/interfaces/binary-tree.ts +1 -1
- package/src/types/data-structures/binary-tree/index.ts +3 -3
- package/src/types/data-structures/binary-tree/tree-map.ts +39 -0
- package/src/types/data-structures/binary-tree/tree-multi-set.ts +13 -0
- package/src/types/data-structures/binary-tree/tree-set.ts +33 -0
- package/test/config.ts +2 -2
- package/test/performance/benchmark-runner-enhanced.mjs +818 -0
- package/test/performance/cmake-benchmark-runner.mjs +234 -0
- package/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp +112 -0
- package/test/performance/data-structures/binary-tree/avl-rb-range-search.test.mjs +51 -0
- package/test/performance/data-structures/binary-tree/avl-tree.test.cpp +181 -0
- package/test/performance/data-structures/binary-tree/avl-tree.test.mjs +138 -0
- package/test/performance/data-structures/binary-tree/binary-tree-overall.test.mjs +85 -0
- package/test/performance/data-structures/binary-tree/binary-tree.test.mjs +100 -0
- package/test/performance/data-structures/binary-tree/bst.test.mjs +61 -0
- package/test/performance/data-structures/binary-tree/red-black-tree-cjs.test.mjs +259 -0
- package/test/performance/data-structures/binary-tree/red-black-tree.test.cpp +213 -0
- package/test/performance/data-structures/binary-tree/red-black-tree.test.mjs +275 -0
- package/test/performance/data-structures/binary-tree/tree-map.test.cpp +129 -0
- package/test/performance/data-structures/binary-tree/tree-map.test.mjs +171 -0
- package/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp +205 -0
- package/test/performance/data-structures/binary-tree/tree-multi-map.test.mjs +106 -0
- package/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp +217 -0
- package/test/performance/data-structures/binary-tree/tree-multi-set.test.mjs +91 -0
- package/test/performance/data-structures/binary-tree/tree-set.test.cpp +127 -0
- package/test/performance/data-structures/binary-tree/tree-set.test.mjs +174 -0
- package/test/performance/data-structures/comparison/{comparison.test.ts → comparison.test.mjs} +17 -17
- package/test/performance/data-structures/graph/{directed-graph.test.ts → directed-graph.test.mjs} +4 -4
- package/test/performance/data-structures/hash/hash-map.test.cpp +183 -0
- package/test/performance/data-structures/hash/hash-map.test.mjs +187 -0
- package/test/performance/data-structures/heap/heap.test.cpp +61 -0
- package/test/performance/data-structures/heap/heap.test.mjs +31 -0
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp +84 -0
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.mjs +125 -0
- package/test/performance/data-structures/linked-list/singly-linked-list.test.cpp +77 -0
- package/test/performance/data-structures/linked-list/singly-linked-list.test.mjs +84 -0
- package/test/performance/data-structures/priority-queue/max-priority-queue.test.mjs +40 -0
- package/test/performance/data-structures/priority-queue/priority-queue.test.cpp +59 -0
- package/test/performance/data-structures/priority-queue/priority-queue.test.mjs +64 -0
- package/test/performance/data-structures/queue/deque.test.cpp +119 -0
- package/test/performance/data-structures/queue/deque.test.mjs +144 -0
- package/test/performance/data-structures/queue/queue.test.cpp +59 -0
- package/test/performance/data-structures/queue/queue.test.mjs +77 -0
- package/test/performance/data-structures/stack/stack.test.cpp +40 -0
- package/test/performance/data-structures/stack/stack.test.mjs +69 -0
- package/test/performance/data-structures/trie/trie.test.mjs +43 -0
- package/test/performance/reportor-enhanced.mjs +871 -0
- package/test/performance/runner-config.json +33 -21
- package/test/unit/data-structures/base/iterable-element-base.more-branches.coverage.test.ts +6 -6
- package/test/unit/data-structures/base/linear-base.array.coverage.test.ts +5 -5
- package/test/unit/data-structures/base/linear-base.concat-else.coverage.test.ts +10 -10
- package/test/unit/data-structures/base/linear-base.more-branches.coverage.test.ts +7 -10
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +5 -5
- package/test/unit/data-structures/binary-tree/binary-tree.remaining-branches.coverage.test.ts +7 -4
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +7 -7
- package/test/unit/data-structures/binary-tree/bst.more-branches-3.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/bst.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/overall.test.ts +18 -31
- package/test/unit/data-structures/binary-tree/red-black-tree.boundary-max-update.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/red-black-tree.cache-stale-insert.coverage.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/red-black-tree.hint-mapmode-defined.coverage.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/red-black-tree.hint-mapmode-undefined.coverage.test.ts +5 -5
- package/test/unit/data-structures/binary-tree/red-black-tree.hint-more.coverage.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/red-black-tree.remaining-branches.coverage.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/red-black-tree.set-inputs.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-parent-cache.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-remaining.coverage.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-uncovered.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/red-black-tree.update-branches.coverage.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/tree-map.test.ts +270 -0
- package/test/unit/data-structures/binary-tree/tree-multi-map.coverage.test.ts +144 -3
- package/test/unit/data-structures/binary-tree/{tree-multi-map.test.ts → tree-multi-map.legacy.test.ts.skip} +16 -16
- package/test/unit/data-structures/binary-tree/tree-multi-map.rfc.test.ts +99 -0
- package/test/unit/data-structures/binary-tree/tree-multi-map.simplified.test.ts +482 -0
- package/test/unit/data-structures/binary-tree/tree-multi-set.test.ts +545 -0
- package/test/unit/data-structures/binary-tree/tree-set.test.ts +187 -0
- package/test/unit/unrestricted-interconversion.test.ts +12 -10
- package/test/utils/patch.ts +3 -3
- package/test/utils/perf.mjs +34 -0
- package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +0 -236
- package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -197
- package/dist/types/data-structures/binary-tree/tree-counter.d.ts +0 -243
- package/dist/types/types/data-structures/binary-tree/avl-tree-counter.d.ts +0 -2
- package/dist/types/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -2
- package/dist/types/types/data-structures/binary-tree/tree-counter.d.ts +0 -2
- package/src/data-structures/binary-tree/avl-tree-counter.ts +0 -539
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +0 -438
- package/src/data-structures/binary-tree/tree-counter.ts +0 -587
- package/src/types/data-structures/binary-tree/avl-tree-counter.ts +0 -3
- package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +0 -3
- package/src/types/data-structures/binary-tree/tree-counter.ts +0 -3
- package/test/performance/benchmark-runner.ts +0 -531
- package/test/performance/data-structures/binary-tree/avl-tree.test.ts +0 -40
- package/test/performance/data-structures/binary-tree/binary-tree-overall.test.ts +0 -37
- package/test/performance/data-structures/binary-tree/binary-tree.test.ts +0 -40
- package/test/performance/data-structures/binary-tree/bst.test.ts +0 -28
- package/test/performance/data-structures/binary-tree/red-black-tree.test.ts +0 -60
- package/test/performance/data-structures/hash/hash-map.test.ts +0 -99
- package/test/performance/data-structures/heap/heap.test.ts +0 -26
- package/test/performance/data-structures/heap/min-heap.test.ts +0 -0
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.ts +0 -59
- package/test/performance/data-structures/linked-list/linked-list.test.ts +0 -0
- package/test/performance/data-structures/linked-list/singly-linked-list.test.ts +0 -35
- package/test/performance/data-structures/linked-list/skip-linked-list.test.ts +0 -0
- package/test/performance/data-structures/linked-list/skip-list.test.ts +0 -0
- package/test/performance/data-structures/matrix/matrix.test.ts +0 -0
- package/test/performance/data-structures/matrix/navigator.test.ts +0 -0
- package/test/performance/data-structures/priority-queue/max-priority-queue.test.ts +0 -17
- package/test/performance/data-structures/priority-queue/min-priority-queue.test.ts +0 -0
- package/test/performance/data-structures/priority-queue/priority-queue.test.ts +0 -34
- package/test/performance/data-structures/queue/deque.test.ts +0 -59
- package/test/performance/data-structures/queue/queue.test.ts +0 -35
- package/test/performance/data-structures/stack/stack.test.ts +0 -37
- package/test/performance/data-structures/trie/trie.test.ts +0 -18
- package/test/performance/reportor.ts +0 -279
- package/test/performance/single-suite-runner.ts +0 -72
- package/test/performance/types/index.ts +0 -1
- package/test/performance/types/reportor.ts +0 -7
- package/test/unit/data-structures/binary-tree/avl-tree-counter.more-branches-3.coverage.test.ts +0 -146
- package/test/unit/data-structures/binary-tree/avl-tree-counter.more-branches.coverage.test.ts +0 -93
- package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +0 -878
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.coverage.test.ts +0 -108
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.more-branches-2.coverage.test.ts +0 -85
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +0 -740
- package/test/unit/data-structures/binary-tree/tree-counter.coverage.test.ts +0 -115
- package/test/unit/data-structures/binary-tree/tree-counter.more-branches.coverage.test.ts +0 -244
- package/test/unit/data-structures/binary-tree/tree-counter.test.ts +0 -979
- /package/{test/performance/data-structures/binary-tree/binary-index-tree.test.ts → build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate-complete} +0 -0
- /package/{test/performance/data-structures/binary-tree/segment-tree.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-build} +0 -0
- /package/{test/performance/data-structures/binary-tree/tree-multimap.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-configure} +0 -0
- /package/{test/performance/data-structures/graph/abstract-graph.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-done} +0 -0
- /package/{test/performance/data-structures/graph/map-graph.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-download} +0 -0
- /package/{test/performance/data-structures/graph/overall.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-install} +0 -0
- /package/{test/performance/data-structures/graph/undirected-graph.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-mkdir} +0 -0
- /package/{test/performance/data-structures/hash/hash-table.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-patch} +0 -0
- /package/{test/performance/data-structures/heap/max-heap.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-test} +0 -0
- /package/test/unit/data-structures/binary-tree/{tree-multi-map.more-branches-2.coverage.test.ts → tree-multi-map.more-branches-2.coverage.test.ts.skip} +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Copyright 2020 Google Inc. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Python benchmarking utilities.
|
|
15
|
+
|
|
16
|
+
Example usage:
|
|
17
|
+
import google_benchmark as benchmark
|
|
18
|
+
|
|
19
|
+
@benchmark.register
|
|
20
|
+
def my_benchmark(state):
|
|
21
|
+
... # Code executed outside `while` loop is not timed.
|
|
22
|
+
|
|
23
|
+
while state:
|
|
24
|
+
... # Code executed within `while` loop is timed.
|
|
25
|
+
|
|
26
|
+
if __name__ == '__main__':
|
|
27
|
+
benchmark.main()
|
|
28
|
+
"""
|
|
29
|
+
import atexit
|
|
30
|
+
|
|
31
|
+
from absl import app
|
|
32
|
+
from google_benchmark import _benchmark
|
|
33
|
+
from google_benchmark._benchmark import (
|
|
34
|
+
Counter,
|
|
35
|
+
kNanosecond,
|
|
36
|
+
kMicrosecond,
|
|
37
|
+
kMillisecond,
|
|
38
|
+
kSecond,
|
|
39
|
+
oNone,
|
|
40
|
+
o1,
|
|
41
|
+
oN,
|
|
42
|
+
oNSquared,
|
|
43
|
+
oNCubed,
|
|
44
|
+
oLogN,
|
|
45
|
+
oNLogN,
|
|
46
|
+
oAuto,
|
|
47
|
+
oLambda,
|
|
48
|
+
State,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
__all__ = [
|
|
53
|
+
"register",
|
|
54
|
+
"main",
|
|
55
|
+
"Counter",
|
|
56
|
+
"kNanosecond",
|
|
57
|
+
"kMicrosecond",
|
|
58
|
+
"kMillisecond",
|
|
59
|
+
"kSecond",
|
|
60
|
+
"oNone",
|
|
61
|
+
"o1",
|
|
62
|
+
"oN",
|
|
63
|
+
"oNSquared",
|
|
64
|
+
"oNCubed",
|
|
65
|
+
"oLogN",
|
|
66
|
+
"oNLogN",
|
|
67
|
+
"oAuto",
|
|
68
|
+
"oLambda",
|
|
69
|
+
"State",
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
__version__ = "1.8.3"
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class __OptionMaker:
|
|
76
|
+
"""A stateless class to collect benchmark options.
|
|
77
|
+
|
|
78
|
+
Collect all decorator calls like @option.range(start=0, limit=1<<5).
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
class Options:
|
|
82
|
+
"""Pure data class to store options calls, along with the benchmarked function."""
|
|
83
|
+
|
|
84
|
+
def __init__(self, func):
|
|
85
|
+
self.func = func
|
|
86
|
+
self.builder_calls = []
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def make(cls, func_or_options):
|
|
90
|
+
"""Make Options from Options or the benchmarked function."""
|
|
91
|
+
if isinstance(func_or_options, cls.Options):
|
|
92
|
+
return func_or_options
|
|
93
|
+
return cls.Options(func_or_options)
|
|
94
|
+
|
|
95
|
+
def __getattr__(self, builder_name):
|
|
96
|
+
"""Append option call in the Options."""
|
|
97
|
+
|
|
98
|
+
# The function that get returned on @option.range(start=0, limit=1<<5).
|
|
99
|
+
def __builder_method(*args, **kwargs):
|
|
100
|
+
|
|
101
|
+
# The decorator that get called, either with the benchmared function
|
|
102
|
+
# or the previous Options
|
|
103
|
+
def __decorator(func_or_options):
|
|
104
|
+
options = self.make(func_or_options)
|
|
105
|
+
options.builder_calls.append((builder_name, args, kwargs))
|
|
106
|
+
# The decorator returns Options so it is not technically a decorator
|
|
107
|
+
# and needs a final call to @register
|
|
108
|
+
return options
|
|
109
|
+
|
|
110
|
+
return __decorator
|
|
111
|
+
|
|
112
|
+
return __builder_method
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# Alias for nicer API.
|
|
116
|
+
# We have to instantiate an object, even if stateless, to be able to use __getattr__
|
|
117
|
+
# on option.range
|
|
118
|
+
option = __OptionMaker()
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def register(undefined=None, *, name=None):
|
|
122
|
+
"""Register function for benchmarking."""
|
|
123
|
+
if undefined is None:
|
|
124
|
+
# Decorator is called without parenthesis so we return a decorator
|
|
125
|
+
return lambda f: register(f, name=name)
|
|
126
|
+
|
|
127
|
+
# We have either the function to benchmark (simple case) or an instance of Options
|
|
128
|
+
# (@option._ case).
|
|
129
|
+
options = __OptionMaker.make(undefined)
|
|
130
|
+
|
|
131
|
+
if name is None:
|
|
132
|
+
name = options.func.__name__
|
|
133
|
+
|
|
134
|
+
# We register the benchmark and reproduce all the @option._ calls onto the
|
|
135
|
+
# benchmark builder pattern
|
|
136
|
+
benchmark = _benchmark.RegisterBenchmark(name, options.func)
|
|
137
|
+
for name, args, kwargs in options.builder_calls[::-1]:
|
|
138
|
+
getattr(benchmark, name)(*args, **kwargs)
|
|
139
|
+
|
|
140
|
+
# return the benchmarked function because the decorator does not modify it
|
|
141
|
+
return options.func
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def _flags_parser(argv):
|
|
145
|
+
argv = _benchmark.Initialize(argv)
|
|
146
|
+
return app.parse_flags_with_usage(argv)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _run_benchmarks(argv):
|
|
150
|
+
if len(argv) > 1:
|
|
151
|
+
raise app.UsageError("Too many command-line arguments.")
|
|
152
|
+
return _benchmark.RunSpecifiedBenchmarks()
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def main(argv=None):
|
|
156
|
+
return app.run(_run_benchmarks, argv=argv, flags_parser=_flags_parser)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
# Methods for use with custom main function.
|
|
160
|
+
initialize = _benchmark.Initialize
|
|
161
|
+
run_benchmarks = _benchmark.RunSpecifiedBenchmarks
|
|
162
|
+
atexit.register(_benchmark.ClearRegisteredBenchmarks)
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// Benchmark for Python.
|
|
2
|
+
|
|
3
|
+
#include "benchmark/benchmark.h"
|
|
4
|
+
|
|
5
|
+
#include "nanobind/nanobind.h"
|
|
6
|
+
#include "nanobind/operators.h"
|
|
7
|
+
#include "nanobind/stl/bind_map.h"
|
|
8
|
+
#include "nanobind/stl/string.h"
|
|
9
|
+
#include "nanobind/stl/vector.h"
|
|
10
|
+
|
|
11
|
+
NB_MAKE_OPAQUE(benchmark::UserCounters);
|
|
12
|
+
|
|
13
|
+
namespace {
|
|
14
|
+
namespace nb = nanobind;
|
|
15
|
+
|
|
16
|
+
std::vector<std::string> Initialize(const std::vector<std::string>& argv) {
|
|
17
|
+
// The `argv` pointers here become invalid when this function returns, but
|
|
18
|
+
// benchmark holds the pointer to `argv[0]`. We create a static copy of it
|
|
19
|
+
// so it persists, and replace the pointer below.
|
|
20
|
+
static std::string executable_name(argv[0]);
|
|
21
|
+
std::vector<char*> ptrs;
|
|
22
|
+
ptrs.reserve(argv.size());
|
|
23
|
+
for (auto& arg : argv) {
|
|
24
|
+
ptrs.push_back(const_cast<char*>(arg.c_str()));
|
|
25
|
+
}
|
|
26
|
+
ptrs[0] = const_cast<char*>(executable_name.c_str());
|
|
27
|
+
int argc = static_cast<int>(argv.size());
|
|
28
|
+
benchmark::Initialize(&argc, ptrs.data());
|
|
29
|
+
std::vector<std::string> remaining_argv;
|
|
30
|
+
remaining_argv.reserve(argc);
|
|
31
|
+
for (int i = 0; i < argc; ++i) {
|
|
32
|
+
remaining_argv.emplace_back(ptrs[i]);
|
|
33
|
+
}
|
|
34
|
+
return remaining_argv;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
benchmark::internal::Benchmark* RegisterBenchmark(const std::string& name,
|
|
38
|
+
nb::callable f) {
|
|
39
|
+
return benchmark::RegisterBenchmark(
|
|
40
|
+
name, [f](benchmark::State& state) { f(&state); });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
NB_MODULE(_benchmark, m) {
|
|
44
|
+
|
|
45
|
+
using benchmark::TimeUnit;
|
|
46
|
+
nb::enum_<TimeUnit>(m, "TimeUnit")
|
|
47
|
+
.value("kNanosecond", TimeUnit::kNanosecond)
|
|
48
|
+
.value("kMicrosecond", TimeUnit::kMicrosecond)
|
|
49
|
+
.value("kMillisecond", TimeUnit::kMillisecond)
|
|
50
|
+
.value("kSecond", TimeUnit::kSecond)
|
|
51
|
+
.export_values();
|
|
52
|
+
|
|
53
|
+
using benchmark::BigO;
|
|
54
|
+
nb::enum_<BigO>(m, "BigO")
|
|
55
|
+
.value("oNone", BigO::oNone)
|
|
56
|
+
.value("o1", BigO::o1)
|
|
57
|
+
.value("oN", BigO::oN)
|
|
58
|
+
.value("oNSquared", BigO::oNSquared)
|
|
59
|
+
.value("oNCubed", BigO::oNCubed)
|
|
60
|
+
.value("oLogN", BigO::oLogN)
|
|
61
|
+
.value("oNLogN", BigO::oNLogN)
|
|
62
|
+
.value("oAuto", BigO::oAuto)
|
|
63
|
+
.value("oLambda", BigO::oLambda)
|
|
64
|
+
.export_values();
|
|
65
|
+
|
|
66
|
+
using benchmark::internal::Benchmark;
|
|
67
|
+
nb::class_<Benchmark>(m, "Benchmark")
|
|
68
|
+
// For methods returning a pointer to the current object, reference
|
|
69
|
+
// return policy is used to ask nanobind not to take ownership of the
|
|
70
|
+
// returned object and avoid calling delete on it.
|
|
71
|
+
// https://pybind11.readthedocs.io/en/stable/advanced/functions.html#return-value-policies
|
|
72
|
+
//
|
|
73
|
+
// For methods taking a const std::vector<...>&, a copy is created
|
|
74
|
+
// because a it is bound to a Python list.
|
|
75
|
+
// https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html
|
|
76
|
+
.def("unit", &Benchmark::Unit, nb::rv_policy::reference)
|
|
77
|
+
.def("arg", &Benchmark::Arg, nb::rv_policy::reference)
|
|
78
|
+
.def("args", &Benchmark::Args, nb::rv_policy::reference)
|
|
79
|
+
.def("range", &Benchmark::Range, nb::rv_policy::reference,
|
|
80
|
+
nb::arg("start"), nb::arg("limit"))
|
|
81
|
+
.def("dense_range", &Benchmark::DenseRange,
|
|
82
|
+
nb::rv_policy::reference, nb::arg("start"),
|
|
83
|
+
nb::arg("limit"), nb::arg("step") = 1)
|
|
84
|
+
.def("ranges", &Benchmark::Ranges, nb::rv_policy::reference)
|
|
85
|
+
.def("args_product", &Benchmark::ArgsProduct,
|
|
86
|
+
nb::rv_policy::reference)
|
|
87
|
+
.def("arg_name", &Benchmark::ArgName, nb::rv_policy::reference)
|
|
88
|
+
.def("arg_names", &Benchmark::ArgNames,
|
|
89
|
+
nb::rv_policy::reference)
|
|
90
|
+
.def("range_pair", &Benchmark::RangePair,
|
|
91
|
+
nb::rv_policy::reference, nb::arg("lo1"), nb::arg("hi1"),
|
|
92
|
+
nb::arg("lo2"), nb::arg("hi2"))
|
|
93
|
+
.def("range_multiplier", &Benchmark::RangeMultiplier,
|
|
94
|
+
nb::rv_policy::reference)
|
|
95
|
+
.def("min_time", &Benchmark::MinTime, nb::rv_policy::reference)
|
|
96
|
+
.def("min_warmup_time", &Benchmark::MinWarmUpTime,
|
|
97
|
+
nb::rv_policy::reference)
|
|
98
|
+
.def("iterations", &Benchmark::Iterations,
|
|
99
|
+
nb::rv_policy::reference)
|
|
100
|
+
.def("repetitions", &Benchmark::Repetitions,
|
|
101
|
+
nb::rv_policy::reference)
|
|
102
|
+
.def("report_aggregates_only", &Benchmark::ReportAggregatesOnly,
|
|
103
|
+
nb::rv_policy::reference, nb::arg("value") = true)
|
|
104
|
+
.def("display_aggregates_only", &Benchmark::DisplayAggregatesOnly,
|
|
105
|
+
nb::rv_policy::reference, nb::arg("value") = true)
|
|
106
|
+
.def("measure_process_cpu_time", &Benchmark::MeasureProcessCPUTime,
|
|
107
|
+
nb::rv_policy::reference)
|
|
108
|
+
.def("use_real_time", &Benchmark::UseRealTime,
|
|
109
|
+
nb::rv_policy::reference)
|
|
110
|
+
.def("use_manual_time", &Benchmark::UseManualTime,
|
|
111
|
+
nb::rv_policy::reference)
|
|
112
|
+
.def(
|
|
113
|
+
"complexity",
|
|
114
|
+
(Benchmark * (Benchmark::*)(benchmark::BigO)) & Benchmark::Complexity,
|
|
115
|
+
nb::rv_policy::reference,
|
|
116
|
+
nb::arg("complexity") = benchmark::oAuto);
|
|
117
|
+
|
|
118
|
+
using benchmark::Counter;
|
|
119
|
+
nb::class_<Counter> py_counter(m, "Counter");
|
|
120
|
+
|
|
121
|
+
nb::enum_<Counter::Flags>(py_counter, "Flags")
|
|
122
|
+
.value("kDefaults", Counter::Flags::kDefaults)
|
|
123
|
+
.value("kIsRate", Counter::Flags::kIsRate)
|
|
124
|
+
.value("kAvgThreads", Counter::Flags::kAvgThreads)
|
|
125
|
+
.value("kAvgThreadsRate", Counter::Flags::kAvgThreadsRate)
|
|
126
|
+
.value("kIsIterationInvariant", Counter::Flags::kIsIterationInvariant)
|
|
127
|
+
.value("kIsIterationInvariantRate",
|
|
128
|
+
Counter::Flags::kIsIterationInvariantRate)
|
|
129
|
+
.value("kAvgIterations", Counter::Flags::kAvgIterations)
|
|
130
|
+
.value("kAvgIterationsRate", Counter::Flags::kAvgIterationsRate)
|
|
131
|
+
.value("kInvert", Counter::Flags::kInvert)
|
|
132
|
+
.export_values()
|
|
133
|
+
.def(nb::self | nb::self);
|
|
134
|
+
|
|
135
|
+
nb::enum_<Counter::OneK>(py_counter, "OneK")
|
|
136
|
+
.value("kIs1000", Counter::OneK::kIs1000)
|
|
137
|
+
.value("kIs1024", Counter::OneK::kIs1024)
|
|
138
|
+
.export_values();
|
|
139
|
+
|
|
140
|
+
py_counter
|
|
141
|
+
.def(nb::init<double, Counter::Flags, Counter::OneK>(),
|
|
142
|
+
nb::arg("value") = 0., nb::arg("flags") = Counter::kDefaults,
|
|
143
|
+
nb::arg("k") = Counter::kIs1000)
|
|
144
|
+
.def("__init__", ([](Counter *c, double value) { new (c) Counter(value); }))
|
|
145
|
+
.def_rw("value", &Counter::value)
|
|
146
|
+
.def_rw("flags", &Counter::flags)
|
|
147
|
+
.def_rw("oneK", &Counter::oneK)
|
|
148
|
+
.def(nb::init_implicit<double>());
|
|
149
|
+
|
|
150
|
+
nb::implicitly_convertible<nb::int_, Counter>();
|
|
151
|
+
|
|
152
|
+
nb::bind_map<benchmark::UserCounters>(m, "UserCounters");
|
|
153
|
+
|
|
154
|
+
using benchmark::State;
|
|
155
|
+
nb::class_<State>(m, "State")
|
|
156
|
+
.def("__bool__", &State::KeepRunning)
|
|
157
|
+
.def_prop_ro("keep_running", &State::KeepRunning)
|
|
158
|
+
.def("pause_timing", &State::PauseTiming)
|
|
159
|
+
.def("resume_timing", &State::ResumeTiming)
|
|
160
|
+
.def("skip_with_error", &State::SkipWithError)
|
|
161
|
+
.def_prop_ro("error_occurred", &State::error_occurred)
|
|
162
|
+
.def("set_iteration_time", &State::SetIterationTime)
|
|
163
|
+
.def_prop_rw("bytes_processed", &State::bytes_processed,
|
|
164
|
+
&State::SetBytesProcessed)
|
|
165
|
+
.def_prop_rw("complexity_n", &State::complexity_length_n,
|
|
166
|
+
&State::SetComplexityN)
|
|
167
|
+
.def_prop_rw("items_processed", &State::items_processed,
|
|
168
|
+
&State::SetItemsProcessed)
|
|
169
|
+
.def("set_label", &State::SetLabel)
|
|
170
|
+
.def("range", &State::range, nb::arg("pos") = 0)
|
|
171
|
+
.def_prop_ro("iterations", &State::iterations)
|
|
172
|
+
.def_prop_ro("name", &State::name)
|
|
173
|
+
.def_rw("counters", &State::counters)
|
|
174
|
+
.def_prop_ro("thread_index", &State::thread_index)
|
|
175
|
+
.def_prop_ro("threads", &State::threads);
|
|
176
|
+
|
|
177
|
+
m.def("Initialize", Initialize);
|
|
178
|
+
m.def("RegisterBenchmark", RegisterBenchmark,
|
|
179
|
+
nb::rv_policy::reference);
|
|
180
|
+
m.def("RunSpecifiedBenchmarks",
|
|
181
|
+
[]() { benchmark::RunSpecifiedBenchmarks(); });
|
|
182
|
+
m.def("ClearRegisteredBenchmarks", benchmark::ClearRegisteredBenchmarks);
|
|
183
|
+
};
|
|
184
|
+
} // namespace
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Copyright 2020 Google Inc. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Example of Python using C++ benchmark framework.
|
|
15
|
+
|
|
16
|
+
To run this example, you must first install the `google_benchmark` Python package.
|
|
17
|
+
|
|
18
|
+
To install using `setup.py`, download and extract the `google_benchmark` source.
|
|
19
|
+
In the extracted directory, execute:
|
|
20
|
+
python setup.py install
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
import random
|
|
24
|
+
import time
|
|
25
|
+
|
|
26
|
+
import google_benchmark as benchmark
|
|
27
|
+
from google_benchmark import Counter
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@benchmark.register
|
|
31
|
+
def empty(state):
|
|
32
|
+
while state:
|
|
33
|
+
pass
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@benchmark.register
|
|
37
|
+
def sum_million(state):
|
|
38
|
+
while state:
|
|
39
|
+
sum(range(1_000_000))
|
|
40
|
+
|
|
41
|
+
@benchmark.register
|
|
42
|
+
def pause_timing(state):
|
|
43
|
+
"""Pause timing every iteration."""
|
|
44
|
+
while state:
|
|
45
|
+
# Construct a list of random ints every iteration without timing it
|
|
46
|
+
state.pause_timing()
|
|
47
|
+
random_list = [random.randint(0, 100) for _ in range(100)]
|
|
48
|
+
state.resume_timing()
|
|
49
|
+
# Time the in place sorting algorithm
|
|
50
|
+
random_list.sort()
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@benchmark.register
|
|
54
|
+
def skipped(state):
|
|
55
|
+
if True: # Test some predicate here.
|
|
56
|
+
state.skip_with_error("some error")
|
|
57
|
+
return # NOTE: You must explicitly return, or benchmark will continue.
|
|
58
|
+
|
|
59
|
+
... # Benchmark code would be here.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@benchmark.register
|
|
63
|
+
def manual_timing(state):
|
|
64
|
+
while state:
|
|
65
|
+
# Manually count Python CPU time
|
|
66
|
+
start = time.perf_counter() # perf_counter_ns() in Python 3.7+
|
|
67
|
+
# Something to benchmark
|
|
68
|
+
time.sleep(0.01)
|
|
69
|
+
end = time.perf_counter()
|
|
70
|
+
state.set_iteration_time(end - start)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@benchmark.register
|
|
74
|
+
def custom_counters(state):
|
|
75
|
+
"""Collect custom metric using benchmark.Counter."""
|
|
76
|
+
num_foo = 0.0
|
|
77
|
+
while state:
|
|
78
|
+
# Benchmark some code here
|
|
79
|
+
pass
|
|
80
|
+
# Collect some custom metric named foo
|
|
81
|
+
num_foo += 0.13
|
|
82
|
+
|
|
83
|
+
# Automatic Counter from numbers.
|
|
84
|
+
state.counters["foo"] = num_foo
|
|
85
|
+
# Set a counter as a rate.
|
|
86
|
+
state.counters["foo_rate"] = Counter(num_foo, Counter.kIsRate)
|
|
87
|
+
# Set a counter as an inverse of rate.
|
|
88
|
+
state.counters["foo_inv_rate"] = Counter(num_foo, Counter.kIsRate | Counter.kInvert)
|
|
89
|
+
# Set a counter as a thread-average quantity.
|
|
90
|
+
state.counters["foo_avg"] = Counter(num_foo, Counter.kAvgThreads)
|
|
91
|
+
# There's also a combined flag:
|
|
92
|
+
state.counters["foo_avg_rate"] = Counter(num_foo, Counter.kAvgThreadsRate)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
@benchmark.register
|
|
96
|
+
@benchmark.option.measure_process_cpu_time()
|
|
97
|
+
@benchmark.option.use_real_time()
|
|
98
|
+
def with_options(state):
|
|
99
|
+
while state:
|
|
100
|
+
sum(range(1_000_000))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@benchmark.register(name="sum_million_microseconds")
|
|
104
|
+
@benchmark.option.unit(benchmark.kMicrosecond)
|
|
105
|
+
def with_options2(state):
|
|
106
|
+
while state:
|
|
107
|
+
sum(range(1_000_000))
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@benchmark.register
|
|
111
|
+
@benchmark.option.arg(100)
|
|
112
|
+
@benchmark.option.arg(1000)
|
|
113
|
+
def passing_argument(state):
|
|
114
|
+
while state:
|
|
115
|
+
sum(range(state.range(0)))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
@benchmark.register
|
|
119
|
+
@benchmark.option.range(8, limit=8 << 10)
|
|
120
|
+
def using_range(state):
|
|
121
|
+
while state:
|
|
122
|
+
sum(range(state.range(0)))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
@benchmark.register
|
|
126
|
+
@benchmark.option.range_multiplier(2)
|
|
127
|
+
@benchmark.option.range(1 << 10, 1 << 18)
|
|
128
|
+
@benchmark.option.complexity(benchmark.oN)
|
|
129
|
+
def computing_complexity(state):
|
|
130
|
+
while state:
|
|
131
|
+
sum(range(state.range(0)))
|
|
132
|
+
state.complexity_n = state.range(0)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
if __name__ == "__main__":
|
|
136
|
+
benchmark.main()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
cc_library(
|
|
2
|
+
name = "nanobind",
|
|
3
|
+
srcs = glob([
|
|
4
|
+
"src/*.cpp"
|
|
5
|
+
]),
|
|
6
|
+
copts = ["-fexceptions"],
|
|
7
|
+
includes = ["include", "ext/robin_map/include"],
|
|
8
|
+
textual_hdrs = glob(
|
|
9
|
+
[
|
|
10
|
+
"include/**/*.h",
|
|
11
|
+
"src/*.h",
|
|
12
|
+
"ext/robin_map/include/tsl/*.h",
|
|
13
|
+
],
|
|
14
|
+
),
|
|
15
|
+
deps = ["@python_headers"],
|
|
16
|
+
visibility = ["//visibility:public"],
|
|
17
|
+
)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# - Adds a compiler flag if it is supported by the compiler
|
|
2
|
+
#
|
|
3
|
+
# This function checks that the supplied compiler flag is supported and then
|
|
4
|
+
# adds it to the corresponding compiler flags
|
|
5
|
+
#
|
|
6
|
+
# add_cxx_compiler_flag(<FLAG> [<VARIANT>])
|
|
7
|
+
#
|
|
8
|
+
# - Example
|
|
9
|
+
#
|
|
10
|
+
# include(AddCXXCompilerFlag)
|
|
11
|
+
# add_cxx_compiler_flag(-Wall)
|
|
12
|
+
# add_cxx_compiler_flag(-no-strict-aliasing RELEASE)
|
|
13
|
+
# Requires CMake 2.6+
|
|
14
|
+
|
|
15
|
+
if(__add_cxx_compiler_flag)
|
|
16
|
+
return()
|
|
17
|
+
endif()
|
|
18
|
+
set(__add_cxx_compiler_flag INCLUDED)
|
|
19
|
+
|
|
20
|
+
include(CheckCXXCompilerFlag)
|
|
21
|
+
|
|
22
|
+
function(mangle_compiler_flag FLAG OUTPUT)
|
|
23
|
+
string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
|
|
24
|
+
string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
|
|
25
|
+
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
|
|
26
|
+
string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
|
|
27
|
+
set(${OUTPUT} "${SANITIZED_FLAG}" PARENT_SCOPE)
|
|
28
|
+
endfunction(mangle_compiler_flag)
|
|
29
|
+
|
|
30
|
+
function(add_cxx_compiler_flag FLAG)
|
|
31
|
+
mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
|
|
32
|
+
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
|
33
|
+
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
|
|
34
|
+
check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
|
|
35
|
+
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
|
|
36
|
+
if(${MANGLED_FLAG})
|
|
37
|
+
if(ARGC GREATER 1)
|
|
38
|
+
set(VARIANT ${ARGV1})
|
|
39
|
+
string(TOUPPER "_${VARIANT}" VARIANT)
|
|
40
|
+
else()
|
|
41
|
+
set(VARIANT "")
|
|
42
|
+
endif()
|
|
43
|
+
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${BENCHMARK_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
|
|
44
|
+
endif()
|
|
45
|
+
endfunction()
|
|
46
|
+
|
|
47
|
+
function(add_required_cxx_compiler_flag FLAG)
|
|
48
|
+
mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
|
|
49
|
+
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
|
50
|
+
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
|
|
51
|
+
check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
|
|
52
|
+
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
|
|
53
|
+
if(${MANGLED_FLAG})
|
|
54
|
+
if(ARGC GREATER 1)
|
|
55
|
+
set(VARIANT ${ARGV1})
|
|
56
|
+
string(TOUPPER "_${VARIANT}" VARIANT)
|
|
57
|
+
else()
|
|
58
|
+
set(VARIANT "")
|
|
59
|
+
endif()
|
|
60
|
+
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
|
|
61
|
+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
|
|
62
|
+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
|
|
63
|
+
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
|
|
64
|
+
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}" PARENT_SCOPE)
|
|
65
|
+
else()
|
|
66
|
+
message(FATAL_ERROR "Required flag '${FLAG}' is not supported by the compiler")
|
|
67
|
+
endif()
|
|
68
|
+
endfunction()
|
|
69
|
+
|
|
70
|
+
function(check_cxx_warning_flag FLAG)
|
|
71
|
+
mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
|
|
72
|
+
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
|
73
|
+
# Add -Werror to ensure the compiler generates an error if the warning flag
|
|
74
|
+
# doesn't exist.
|
|
75
|
+
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror ${FLAG}")
|
|
76
|
+
check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
|
|
77
|
+
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
|
|
78
|
+
endfunction()
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# - Compile and run code to check for C++ features
|
|
2
|
+
#
|
|
3
|
+
# This functions compiles a source file under the `cmake` folder
|
|
4
|
+
# and adds the corresponding `HAVE_[FILENAME]` flag to the CMake
|
|
5
|
+
# environment
|
|
6
|
+
#
|
|
7
|
+
# cxx_feature_check(<FLAG> [<VARIANT>])
|
|
8
|
+
#
|
|
9
|
+
# - Example
|
|
10
|
+
#
|
|
11
|
+
# include(CXXFeatureCheck)
|
|
12
|
+
# cxx_feature_check(STD_REGEX)
|
|
13
|
+
# Requires CMake 2.8.12+
|
|
14
|
+
|
|
15
|
+
if(__cxx_feature_check)
|
|
16
|
+
return()
|
|
17
|
+
endif()
|
|
18
|
+
set(__cxx_feature_check INCLUDED)
|
|
19
|
+
|
|
20
|
+
option(CXXFEATURECHECK_DEBUG OFF)
|
|
21
|
+
|
|
22
|
+
function(cxx_feature_check FILE)
|
|
23
|
+
string(TOLOWER ${FILE} FILE)
|
|
24
|
+
string(TOUPPER ${FILE} VAR)
|
|
25
|
+
string(TOUPPER "HAVE_${VAR}" FEATURE)
|
|
26
|
+
if (DEFINED HAVE_${VAR})
|
|
27
|
+
set(HAVE_${VAR} 1 PARENT_SCOPE)
|
|
28
|
+
add_definitions(-DHAVE_${VAR})
|
|
29
|
+
return()
|
|
30
|
+
endif()
|
|
31
|
+
|
|
32
|
+
set(FEATURE_CHECK_CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS})
|
|
33
|
+
if (ARGC GREATER 1)
|
|
34
|
+
message(STATUS "Enabling additional flags: ${ARGV1}")
|
|
35
|
+
list(APPEND FEATURE_CHECK_CMAKE_FLAGS ${ARGV1})
|
|
36
|
+
endif()
|
|
37
|
+
|
|
38
|
+
if (NOT DEFINED COMPILE_${FEATURE})
|
|
39
|
+
if(CMAKE_CROSSCOMPILING)
|
|
40
|
+
message(STATUS "Cross-compiling to test ${FEATURE}")
|
|
41
|
+
try_compile(COMPILE_${FEATURE}
|
|
42
|
+
${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp
|
|
43
|
+
CXX_STANDARD 11
|
|
44
|
+
CXX_STANDARD_REQUIRED ON
|
|
45
|
+
CMAKE_FLAGS ${FEATURE_CHECK_CMAKE_FLAGS}
|
|
46
|
+
LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES}
|
|
47
|
+
OUTPUT_VARIABLE COMPILE_OUTPUT_VAR)
|
|
48
|
+
if(COMPILE_${FEATURE})
|
|
49
|
+
message(WARNING
|
|
50
|
+
"If you see build failures due to cross compilation, try setting HAVE_${VAR} to 0")
|
|
51
|
+
set(RUN_${FEATURE} 0 CACHE INTERNAL "")
|
|
52
|
+
else()
|
|
53
|
+
set(RUN_${FEATURE} 1 CACHE INTERNAL "")
|
|
54
|
+
endif()
|
|
55
|
+
else()
|
|
56
|
+
message(STATUS "Compiling and running to test ${FEATURE}")
|
|
57
|
+
try_run(RUN_${FEATURE} COMPILE_${FEATURE}
|
|
58
|
+
${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp
|
|
59
|
+
CXX_STANDARD 11
|
|
60
|
+
CXX_STANDARD_REQUIRED ON
|
|
61
|
+
CMAKE_FLAGS ${FEATURE_CHECK_CMAKE_FLAGS}
|
|
62
|
+
LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES}
|
|
63
|
+
COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT_VAR)
|
|
64
|
+
endif()
|
|
65
|
+
endif()
|
|
66
|
+
|
|
67
|
+
if(RUN_${FEATURE} EQUAL 0)
|
|
68
|
+
message(STATUS "Performing Test ${FEATURE} -- success")
|
|
69
|
+
set(HAVE_${VAR} 1 PARENT_SCOPE)
|
|
70
|
+
add_definitions(-DHAVE_${VAR})
|
|
71
|
+
else()
|
|
72
|
+
if(NOT COMPILE_${FEATURE})
|
|
73
|
+
if(CXXFEATURECHECK_DEBUG)
|
|
74
|
+
message(STATUS "Performing Test ${FEATURE} -- failed to compile: ${COMPILE_OUTPUT_VAR}")
|
|
75
|
+
else()
|
|
76
|
+
message(STATUS "Performing Test ${FEATURE} -- failed to compile")
|
|
77
|
+
endif()
|
|
78
|
+
else()
|
|
79
|
+
message(STATUS "Performing Test ${FEATURE} -- compiled but failed to run")
|
|
80
|
+
endif()
|
|
81
|
+
endif()
|
|
82
|
+
endfunction()
|