data-structure-typed 2.4.0 → 2.4.2

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.
Files changed (750) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +2 -3
  3. package/README_CN.md +0 -1
  4. package/dist/cjs/index.cjs +85 -30
  5. package/dist/cjs-legacy/index.cjs +85 -30
  6. package/dist/esm/index.mjs +85 -30
  7. package/dist/esm-legacy/index.mjs +85 -30
  8. package/dist/types/data-structures/binary-tree/tree-map.d.ts +17 -6
  9. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +13 -5
  10. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +12 -5
  11. package/dist/types/data-structures/binary-tree/tree-set.d.ts +15 -4
  12. package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +6 -1
  13. package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +6 -1
  14. package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +6 -1
  15. package/dist/umd/data-structure-typed.js +85 -29
  16. package/dist/umd/data-structure-typed.min.js +4 -4
  17. package/package.json +11 -5
  18. package/src/data-structures/binary-tree/tree-map.ts +35 -13
  19. package/src/data-structures/binary-tree/tree-multi-map.ts +41 -20
  20. package/src/data-structures/binary-tree/tree-multi-set.ts +17 -6
  21. package/src/data-structures/binary-tree/tree-set.ts +19 -6
  22. package/src/data-structures/trie/trie.ts +6 -8
  23. package/src/types/data-structures/binary-tree/tree-map.ts +7 -1
  24. package/src/types/data-structures/binary-tree/tree-multi-set.ts +7 -1
  25. package/src/types/data-structures/binary-tree/tree-set.ts +7 -1
  26. package/CMakeLists.txt +0 -52
  27. package/benchmark/report.html +0 -143
  28. package/benchmark/report.json +0 -1972
  29. package/build/CMakeCache.txt +0 -603
  30. package/build/CMakeFiles/4.0.3/CMakeCXXCompiler.cmake +0 -104
  31. package/build/CMakeFiles/4.0.3/CMakeDetermineCompilerABI_CXX.bin +0 -0
  32. package/build/CMakeFiles/4.0.3/CMakeSystem.cmake +0 -15
  33. package/build/CMakeFiles/4.0.3/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -920
  34. package/build/CMakeFiles/4.0.3/CompilerIdCXX/a.out +0 -0
  35. package/build/CMakeFiles/4.0.3/CompilerIdCXX/apple-sdk.cpp +0 -1
  36. package/build/CMakeFiles/CMakeConfigureLog.yaml +0 -2146
  37. package/build/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  38. package/build/CMakeFiles/InstallScripts.json +0 -9
  39. package/build/CMakeFiles/Makefile.cmake +0 -100
  40. package/build/CMakeFiles/Makefile2 +0 -720
  41. package/build/CMakeFiles/TargetDirectories.txt +0 -23
  42. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/DependInfo.cmake +0 -23
  43. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/build.make +0 -114
  44. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/cmake_clean.cmake +0 -11
  45. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.internal +0 -839
  46. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.make +0 -2506
  47. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.ts +0 -2
  48. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/depend.make +0 -2
  49. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/flags.make +0 -10
  50. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/link.txt +0 -1
  51. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/progress.make +0 -3
  52. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp.o +0 -0
  53. package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp.o.d +0 -835
  54. package/build/CMakeFiles/avl-tree-benchmark.dir/DependInfo.cmake +0 -23
  55. package/build/CMakeFiles/avl-tree-benchmark.dir/build.make +0 -114
  56. package/build/CMakeFiles/avl-tree-benchmark.dir/cmake_clean.cmake +0 -11
  57. package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.internal +0 -839
  58. package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.make +0 -2506
  59. package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.ts +0 -2
  60. package/build/CMakeFiles/avl-tree-benchmark.dir/depend.make +0 -2
  61. package/build/CMakeFiles/avl-tree-benchmark.dir/flags.make +0 -10
  62. package/build/CMakeFiles/avl-tree-benchmark.dir/link.txt +0 -1
  63. package/build/CMakeFiles/avl-tree-benchmark.dir/progress.make +0 -3
  64. package/build/CMakeFiles/avl-tree-benchmark.dir/test/performance/data-structures/binary-tree/avl-tree.test.cpp.o +0 -0
  65. package/build/CMakeFiles/avl-tree-benchmark.dir/test/performance/data-structures/binary-tree/avl-tree.test.cpp.o.d +0 -835
  66. package/build/CMakeFiles/cmake.check_cache +0 -1
  67. package/build/CMakeFiles/deque-benchmark.dir/DependInfo.cmake +0 -23
  68. package/build/CMakeFiles/deque-benchmark.dir/build.make +0 -114
  69. package/build/CMakeFiles/deque-benchmark.dir/cmake_clean.cmake +0 -11
  70. package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.internal +0 -791
  71. package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.make +0 -2362
  72. package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.ts +0 -2
  73. package/build/CMakeFiles/deque-benchmark.dir/depend.make +0 -2
  74. package/build/CMakeFiles/deque-benchmark.dir/flags.make +0 -10
  75. package/build/CMakeFiles/deque-benchmark.dir/link.txt +0 -1
  76. package/build/CMakeFiles/deque-benchmark.dir/progress.make +0 -3
  77. package/build/CMakeFiles/deque-benchmark.dir/test/performance/data-structures/queue/deque.test.cpp.o +0 -0
  78. package/build/CMakeFiles/deque-benchmark.dir/test/performance/data-structures/queue/deque.test.cpp.o.d +0 -787
  79. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/DependInfo.cmake +0 -23
  80. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/build.make +0 -114
  81. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/cmake_clean.cmake +0 -11
  82. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.internal +0 -790
  83. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.make +0 -2359
  84. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.ts +0 -2
  85. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/depend.make +0 -2
  86. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/flags.make +0 -10
  87. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/link.txt +0 -1
  88. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/progress.make +0 -3
  89. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp.o +0 -0
  90. package/build/CMakeFiles/doubly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp.o.d +0 -786
  91. package/build/CMakeFiles/hash-map-benchmark.dir/DependInfo.cmake +0 -23
  92. package/build/CMakeFiles/hash-map-benchmark.dir/build.make +0 -114
  93. package/build/CMakeFiles/hash-map-benchmark.dir/cmake_clean.cmake +0 -11
  94. package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.internal +0 -790
  95. package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.make +0 -2359
  96. package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.ts +0 -2
  97. package/build/CMakeFiles/hash-map-benchmark.dir/depend.make +0 -2
  98. package/build/CMakeFiles/hash-map-benchmark.dir/flags.make +0 -10
  99. package/build/CMakeFiles/hash-map-benchmark.dir/link.txt +0 -1
  100. package/build/CMakeFiles/hash-map-benchmark.dir/progress.make +0 -3
  101. package/build/CMakeFiles/hash-map-benchmark.dir/test/performance/data-structures/hash/hash-map.test.cpp.o +0 -0
  102. package/build/CMakeFiles/hash-map-benchmark.dir/test/performance/data-structures/hash/hash-map.test.cpp.o.d +0 -786
  103. package/build/CMakeFiles/heap-benchmark.dir/DependInfo.cmake +0 -23
  104. package/build/CMakeFiles/heap-benchmark.dir/build.make +0 -114
  105. package/build/CMakeFiles/heap-benchmark.dir/cmake_clean.cmake +0 -11
  106. package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.internal +0 -843
  107. package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.make +0 -2518
  108. package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.ts +0 -2
  109. package/build/CMakeFiles/heap-benchmark.dir/depend.make +0 -2
  110. package/build/CMakeFiles/heap-benchmark.dir/flags.make +0 -10
  111. package/build/CMakeFiles/heap-benchmark.dir/link.txt +0 -1
  112. package/build/CMakeFiles/heap-benchmark.dir/progress.make +0 -3
  113. package/build/CMakeFiles/heap-benchmark.dir/test/performance/data-structures/heap/heap.test.cpp.o +0 -0
  114. package/build/CMakeFiles/heap-benchmark.dir/test/performance/data-structures/heap/heap.test.cpp.o.d +0 -839
  115. package/build/CMakeFiles/priority-queue-benchmark.dir/DependInfo.cmake +0 -23
  116. package/build/CMakeFiles/priority-queue-benchmark.dir/build.make +0 -114
  117. package/build/CMakeFiles/priority-queue-benchmark.dir/cmake_clean.cmake +0 -11
  118. package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.internal +0 -793
  119. package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.make +0 -2368
  120. package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.ts +0 -2
  121. package/build/CMakeFiles/priority-queue-benchmark.dir/depend.make +0 -2
  122. package/build/CMakeFiles/priority-queue-benchmark.dir/flags.make +0 -10
  123. package/build/CMakeFiles/priority-queue-benchmark.dir/link.txt +0 -1
  124. package/build/CMakeFiles/priority-queue-benchmark.dir/progress.make +0 -3
  125. package/build/CMakeFiles/priority-queue-benchmark.dir/test/performance/data-structures/priority-queue/priority-queue.test.cpp.o +0 -0
  126. package/build/CMakeFiles/priority-queue-benchmark.dir/test/performance/data-structures/priority-queue/priority-queue.test.cpp.o.d +0 -789
  127. package/build/CMakeFiles/progress.marks +0 -1
  128. package/build/CMakeFiles/queue-benchmark.dir/DependInfo.cmake +0 -23
  129. package/build/CMakeFiles/queue-benchmark.dir/build.make +0 -114
  130. package/build/CMakeFiles/queue-benchmark.dir/cmake_clean.cmake +0 -11
  131. package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.internal +0 -793
  132. package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.make +0 -2368
  133. package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.ts +0 -2
  134. package/build/CMakeFiles/queue-benchmark.dir/depend.make +0 -2
  135. package/build/CMakeFiles/queue-benchmark.dir/flags.make +0 -10
  136. package/build/CMakeFiles/queue-benchmark.dir/link.txt +0 -1
  137. package/build/CMakeFiles/queue-benchmark.dir/progress.make +0 -3
  138. package/build/CMakeFiles/queue-benchmark.dir/test/performance/data-structures/queue/queue.test.cpp.o +0 -0
  139. package/build/CMakeFiles/queue-benchmark.dir/test/performance/data-structures/queue/queue.test.cpp.o.d +0 -789
  140. package/build/CMakeFiles/red-black-tree-benchmark.dir/DependInfo.cmake +0 -23
  141. package/build/CMakeFiles/red-black-tree-benchmark.dir/build.make +0 -114
  142. package/build/CMakeFiles/red-black-tree-benchmark.dir/cmake_clean.cmake +0 -11
  143. package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.internal +0 -839
  144. package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.make +0 -2506
  145. package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.ts +0 -2
  146. package/build/CMakeFiles/red-black-tree-benchmark.dir/depend.make +0 -2
  147. package/build/CMakeFiles/red-black-tree-benchmark.dir/flags.make +0 -10
  148. package/build/CMakeFiles/red-black-tree-benchmark.dir/link.txt +0 -1
  149. package/build/CMakeFiles/red-black-tree-benchmark.dir/progress.make +0 -3
  150. package/build/CMakeFiles/red-black-tree-benchmark.dir/test/performance/data-structures/binary-tree/red-black-tree.test.cpp.o +0 -0
  151. package/build/CMakeFiles/red-black-tree-benchmark.dir/test/performance/data-structures/binary-tree/red-black-tree.test.cpp.o.d +0 -835
  152. package/build/CMakeFiles/singly-linked-list-benchmark.dir/DependInfo.cmake +0 -23
  153. package/build/CMakeFiles/singly-linked-list-benchmark.dir/build.make +0 -114
  154. package/build/CMakeFiles/singly-linked-list-benchmark.dir/cmake_clean.cmake +0 -11
  155. package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.internal +0 -790
  156. package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.make +0 -2359
  157. package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.ts +0 -2
  158. package/build/CMakeFiles/singly-linked-list-benchmark.dir/depend.make +0 -2
  159. package/build/CMakeFiles/singly-linked-list-benchmark.dir/flags.make +0 -10
  160. package/build/CMakeFiles/singly-linked-list-benchmark.dir/link.txt +0 -1
  161. package/build/CMakeFiles/singly-linked-list-benchmark.dir/progress.make +0 -3
  162. package/build/CMakeFiles/singly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/singly-linked-list.test.cpp.o +0 -0
  163. package/build/CMakeFiles/singly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/singly-linked-list.test.cpp.o.d +0 -786
  164. package/build/CMakeFiles/stack-benchmark.dir/DependInfo.cmake +0 -23
  165. package/build/CMakeFiles/stack-benchmark.dir/build.make +0 -114
  166. package/build/CMakeFiles/stack-benchmark.dir/cmake_clean.cmake +0 -11
  167. package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.internal +0 -793
  168. package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.make +0 -2368
  169. package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.ts +0 -2
  170. package/build/CMakeFiles/stack-benchmark.dir/depend.make +0 -2
  171. package/build/CMakeFiles/stack-benchmark.dir/flags.make +0 -10
  172. package/build/CMakeFiles/stack-benchmark.dir/link.txt +0 -1
  173. package/build/CMakeFiles/stack-benchmark.dir/progress.make +0 -3
  174. package/build/CMakeFiles/stack-benchmark.dir/test/performance/data-structures/stack/stack.test.cpp.o +0 -0
  175. package/build/CMakeFiles/stack-benchmark.dir/test/performance/data-structures/stack/stack.test.cpp.o.d +0 -789
  176. package/build/CMakeFiles/tree-map-benchmark.dir/DependInfo.cmake +0 -23
  177. package/build/CMakeFiles/tree-map-benchmark.dir/build.make +0 -114
  178. package/build/CMakeFiles/tree-map-benchmark.dir/cmake_clean.cmake +0 -11
  179. package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.internal +0 -839
  180. package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.make +0 -2506
  181. package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.ts +0 -2
  182. package/build/CMakeFiles/tree-map-benchmark.dir/depend.make +0 -2
  183. package/build/CMakeFiles/tree-map-benchmark.dir/flags.make +0 -10
  184. package/build/CMakeFiles/tree-map-benchmark.dir/link.txt +0 -1
  185. package/build/CMakeFiles/tree-map-benchmark.dir/progress.make +0 -3
  186. package/build/CMakeFiles/tree-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-map.test.cpp.o +0 -0
  187. package/build/CMakeFiles/tree-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-map.test.cpp.o.d +0 -835
  188. package/build/CMakeFiles/tree-multi-map-benchmark.dir/DependInfo.cmake +0 -23
  189. package/build/CMakeFiles/tree-multi-map-benchmark.dir/build.make +0 -114
  190. package/build/CMakeFiles/tree-multi-map-benchmark.dir/cmake_clean.cmake +0 -11
  191. package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.internal +0 -839
  192. package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.make +0 -2506
  193. package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.ts +0 -2
  194. package/build/CMakeFiles/tree-multi-map-benchmark.dir/depend.make +0 -2
  195. package/build/CMakeFiles/tree-multi-map-benchmark.dir/flags.make +0 -10
  196. package/build/CMakeFiles/tree-multi-map-benchmark.dir/link.txt +0 -1
  197. package/build/CMakeFiles/tree-multi-map-benchmark.dir/progress.make +0 -3
  198. package/build/CMakeFiles/tree-multi-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp.o +0 -0
  199. package/build/CMakeFiles/tree-multi-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp.o.d +0 -835
  200. package/build/CMakeFiles/tree-multi-set-benchmark.dir/DependInfo.cmake +0 -23
  201. package/build/CMakeFiles/tree-multi-set-benchmark.dir/build.make +0 -114
  202. package/build/CMakeFiles/tree-multi-set-benchmark.dir/cmake_clean.cmake +0 -11
  203. package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.internal +0 -839
  204. package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.make +0 -2506
  205. package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.ts +0 -2
  206. package/build/CMakeFiles/tree-multi-set-benchmark.dir/depend.make +0 -2
  207. package/build/CMakeFiles/tree-multi-set-benchmark.dir/flags.make +0 -10
  208. package/build/CMakeFiles/tree-multi-set-benchmark.dir/link.txt +0 -1
  209. package/build/CMakeFiles/tree-multi-set-benchmark.dir/progress.make +0 -3
  210. package/build/CMakeFiles/tree-multi-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp.o +0 -0
  211. package/build/CMakeFiles/tree-multi-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp.o.d +0 -835
  212. package/build/CMakeFiles/tree-set-benchmark.dir/DependInfo.cmake +0 -23
  213. package/build/CMakeFiles/tree-set-benchmark.dir/build.make +0 -114
  214. package/build/CMakeFiles/tree-set-benchmark.dir/cmake_clean.cmake +0 -11
  215. package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.internal +0 -839
  216. package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.make +0 -2506
  217. package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.ts +0 -2
  218. package/build/CMakeFiles/tree-set-benchmark.dir/depend.make +0 -2
  219. package/build/CMakeFiles/tree-set-benchmark.dir/flags.make +0 -10
  220. package/build/CMakeFiles/tree-set-benchmark.dir/link.txt +0 -1
  221. package/build/CMakeFiles/tree-set-benchmark.dir/progress.make +0 -3
  222. package/build/CMakeFiles/tree-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-set.test.cpp.o +0 -0
  223. package/build/CMakeFiles/tree-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-set.test.cpp.o.d +0 -835
  224. package/build/Makefile +0 -783
  225. package/build/_deps/benchmark-build/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  226. package/build/_deps/benchmark-build/CMakeFiles/progress.marks +0 -1
  227. package/build/_deps/benchmark-build/Makefile +0 -140
  228. package/build/_deps/benchmark-build/benchmark.pc +0 -12
  229. package/build/_deps/benchmark-build/benchmarkConfig.cmake +0 -14
  230. package/build/_deps/benchmark-build/benchmarkConfigVersion.cmake +0 -65
  231. package/build/_deps/benchmark-build/benchmarkTargets.cmake +0 -84
  232. package/build/_deps/benchmark-build/cmake_install.cmake +0 -50
  233. package/build/_deps/benchmark-build/src/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  234. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/DependInfo.cmake +0 -41
  235. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o +0 -0
  236. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o.d +0 -875
  237. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o +0 -0
  238. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o.d +0 -802
  239. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_name.cc.o +0 -0
  240. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_name.cc.o.d +0 -772
  241. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o +0 -0
  242. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o.d +0 -841
  243. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o +0 -0
  244. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o.d +0 -833
  245. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/build.make +0 -402
  246. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/check.cc.o +0 -0
  247. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/check.cc.o.d +0 -784
  248. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/cmake_clean.cmake +0 -47
  249. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/cmake_clean_target.cmake +0 -3
  250. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/colorprint.cc.o +0 -0
  251. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/colorprint.cc.o.d +0 -791
  252. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/commandlineflags.cc.o +0 -0
  253. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/commandlineflags.cc.o.d +0 -795
  254. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.internal +0 -15519
  255. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.make +0 -17500
  256. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.ts +0 -2
  257. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/complexity.cc.o +0 -0
  258. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/complexity.cc.o.d +0 -793
  259. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/console_reporter.cc.o +0 -0
  260. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/console_reporter.cc.o.d +0 -802
  261. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/counter.cc.o +0 -0
  262. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/counter.cc.o.d +0 -773
  263. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/csv_reporter.cc.o +0 -0
  264. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/csv_reporter.cc.o.d +0 -799
  265. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/depend.make +0 -2
  266. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/flags.make +0 -10
  267. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/json_reporter.cc.o +0 -0
  268. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/json_reporter.cc.o.d +0 -800
  269. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/link.txt +0 -2
  270. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/perf_counters.cc.o +0 -0
  271. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/perf_counters.cc.o.d +0 -807
  272. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/progress.make +0 -21
  273. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/reporter.cc.o +0 -0
  274. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/reporter.cc.o.d +0 -798
  275. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/statistics.cc.o +0 -0
  276. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/statistics.cc.o.d +0 -800
  277. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/string_util.cc.o +0 -0
  278. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/string_util.cc.o.d +0 -795
  279. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/sysinfo.cc.o +0 -0
  280. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/sysinfo.cc.o.d +0 -933
  281. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/timers.cc.o +0 -0
  282. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/timers.cc.o.d +0 -904
  283. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/DependInfo.cmake +0 -23
  284. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o +0 -0
  285. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o.d +0 -772
  286. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/build.make +0 -114
  287. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/cmake_clean.cmake +0 -11
  288. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/cmake_clean_target.cmake +0 -3
  289. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.internal +0 -776
  290. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.make +0 -2317
  291. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.ts +0 -2
  292. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/depend.make +0 -2
  293. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/flags.make +0 -10
  294. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/link.txt +0 -2
  295. package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/progress.make +0 -3
  296. package/build/_deps/benchmark-build/src/CMakeFiles/progress.marks +0 -1
  297. package/build/_deps/benchmark-build/src/Makefile +0 -710
  298. package/build/_deps/benchmark-build/src/cmake_install.cmake +0 -45
  299. package/build/_deps/benchmark-build/src/libbenchmark.a +0 -0
  300. package/build/_deps/benchmark-build/src/libbenchmark_main.a +0 -0
  301. package/build/_deps/benchmark-src/.clang-format +0 -5
  302. package/build/_deps/benchmark-src/.clang-tidy +0 -7
  303. package/build/_deps/benchmark-src/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
  304. package/build/_deps/benchmark-src/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  305. package/build/_deps/benchmark-src/.github/install_bazel.sh +0 -13
  306. package/build/_deps/benchmark-src/.github/libcxx-setup.sh +0 -26
  307. package/build/_deps/benchmark-src/.github/workflows/bazel.yml +0 -35
  308. package/build/_deps/benchmark-src/.github/workflows/build-and-test-min-cmake.yml +0 -46
  309. package/build/_deps/benchmark-src/.github/workflows/build-and-test-perfcounters.yml +0 -51
  310. package/build/_deps/benchmark-src/.github/workflows/build-and-test.yml +0 -114
  311. package/build/_deps/benchmark-src/.github/workflows/clang-format-lint.yml +0 -17
  312. package/build/_deps/benchmark-src/.github/workflows/clang-tidy.yml +0 -38
  313. package/build/_deps/benchmark-src/.github/workflows/doxygen.yml +0 -28
  314. package/build/_deps/benchmark-src/.github/workflows/pylint.yml +0 -28
  315. package/build/_deps/benchmark-src/.github/workflows/sanitizer.yml +0 -96
  316. package/build/_deps/benchmark-src/.github/workflows/test_bindings.yml +0 -29
  317. package/build/_deps/benchmark-src/.github/workflows/wheels.yml +0 -79
  318. package/build/_deps/benchmark-src/.travis.yml +0 -208
  319. package/build/_deps/benchmark-src/.ycm_extra_conf.py +0 -115
  320. package/build/_deps/benchmark-src/AUTHORS +0 -71
  321. package/build/_deps/benchmark-src/BUILD.bazel +0 -87
  322. package/build/_deps/benchmark-src/CMakeLists.txt +0 -340
  323. package/build/_deps/benchmark-src/CONTRIBUTING.md +0 -58
  324. package/build/_deps/benchmark-src/CONTRIBUTORS +0 -95
  325. package/build/_deps/benchmark-src/LICENSE +0 -202
  326. package/build/_deps/benchmark-src/MODULE.bazel +0 -24
  327. package/build/_deps/benchmark-src/README.md +0 -223
  328. package/build/_deps/benchmark-src/WORKSPACE +0 -22
  329. package/build/_deps/benchmark-src/WORKSPACE.bzlmod +0 -2
  330. package/build/_deps/benchmark-src/_config.yml +0 -2
  331. package/build/_deps/benchmark-src/appveyor.yml +0 -50
  332. package/build/_deps/benchmark-src/bazel/benchmark_deps.bzl +0 -65
  333. package/build/_deps/benchmark-src/bindings/python/BUILD +0 -3
  334. package/build/_deps/benchmark-src/bindings/python/build_defs.bzl +0 -25
  335. package/build/_deps/benchmark-src/bindings/python/google_benchmark/BUILD +0 -40
  336. package/build/_deps/benchmark-src/bindings/python/google_benchmark/__init__.py +0 -162
  337. package/build/_deps/benchmark-src/bindings/python/google_benchmark/benchmark.cc +0 -184
  338. package/build/_deps/benchmark-src/bindings/python/google_benchmark/example.py +0 -136
  339. package/build/_deps/benchmark-src/bindings/python/nanobind.BUILD +0 -17
  340. package/build/_deps/benchmark-src/bindings/python/python_headers.BUILD +0 -6
  341. package/build/_deps/benchmark-src/cmake/AddCXXCompilerFlag.cmake +0 -78
  342. package/build/_deps/benchmark-src/cmake/CXXFeatureCheck.cmake +0 -82
  343. package/build/_deps/benchmark-src/cmake/Config.cmake.in +0 -7
  344. package/build/_deps/benchmark-src/cmake/GetGitVersion.cmake +0 -58
  345. package/build/_deps/benchmark-src/cmake/GoogleTest.cmake +0 -58
  346. package/build/_deps/benchmark-src/cmake/GoogleTest.cmake.in +0 -59
  347. package/build/_deps/benchmark-src/cmake/benchmark.pc.in +0 -12
  348. package/build/_deps/benchmark-src/cmake/gnu_posix_regex.cpp +0 -12
  349. package/build/_deps/benchmark-src/cmake/llvm-toolchain.cmake +0 -8
  350. package/build/_deps/benchmark-src/cmake/posix_regex.cpp +0 -14
  351. package/build/_deps/benchmark-src/cmake/pthread_affinity.cpp +0 -16
  352. package/build/_deps/benchmark-src/cmake/split_list.cmake +0 -3
  353. package/build/_deps/benchmark-src/cmake/std_regex.cpp +0 -10
  354. package/build/_deps/benchmark-src/cmake/steady_clock.cpp +0 -7
  355. package/build/_deps/benchmark-src/cmake/thread_safety_attributes.cpp +0 -4
  356. package/build/_deps/benchmark-src/docs/AssemblyTests.md +0 -149
  357. package/build/_deps/benchmark-src/docs/_config.yml +0 -3
  358. package/build/_deps/benchmark-src/docs/assets/images/icon.png +0 -0
  359. package/build/_deps/benchmark-src/docs/assets/images/icon.xcf +0 -0
  360. package/build/_deps/benchmark-src/docs/assets/images/icon_black.png +0 -0
  361. package/build/_deps/benchmark-src/docs/assets/images/icon_black.xcf +0 -0
  362. package/build/_deps/benchmark-src/docs/dependencies.md +0 -13
  363. package/build/_deps/benchmark-src/docs/index.md +0 -12
  364. package/build/_deps/benchmark-src/docs/perf_counters.md +0 -35
  365. package/build/_deps/benchmark-src/docs/platform_specific_build_instructions.md +0 -48
  366. package/build/_deps/benchmark-src/docs/python_bindings.md +0 -34
  367. package/build/_deps/benchmark-src/docs/random_interleaving.md +0 -13
  368. package/build/_deps/benchmark-src/docs/reducing_variance.md +0 -100
  369. package/build/_deps/benchmark-src/docs/releasing.md +0 -41
  370. package/build/_deps/benchmark-src/docs/tools.md +0 -343
  371. package/build/_deps/benchmark-src/docs/user_guide.md +0 -1266
  372. package/build/_deps/benchmark-src/include/benchmark/benchmark.h +0 -1991
  373. package/build/_deps/benchmark-src/include/benchmark/export.h +0 -47
  374. package/build/_deps/benchmark-src/pyproject.toml +0 -50
  375. package/build/_deps/benchmark-src/setup.py +0 -113
  376. package/build/_deps/benchmark-src/src/CMakeLists.txt +0 -170
  377. package/build/_deps/benchmark-src/src/arraysize.h +0 -33
  378. package/build/_deps/benchmark-src/src/benchmark.cc +0 -779
  379. package/build/_deps/benchmark-src/src/benchmark_api_internal.cc +0 -118
  380. package/build/_deps/benchmark-src/src/benchmark_api_internal.h +0 -87
  381. package/build/_deps/benchmark-src/src/benchmark_main.cc +0 -18
  382. package/build/_deps/benchmark-src/src/benchmark_name.cc +0 -59
  383. package/build/_deps/benchmark-src/src/benchmark_register.cc +0 -520
  384. package/build/_deps/benchmark-src/src/benchmark_register.h +0 -109
  385. package/build/_deps/benchmark-src/src/benchmark_runner.cc +0 -497
  386. package/build/_deps/benchmark-src/src/benchmark_runner.h +0 -131
  387. package/build/_deps/benchmark-src/src/check.cc +0 -11
  388. package/build/_deps/benchmark-src/src/check.h +0 -106
  389. package/build/_deps/benchmark-src/src/colorprint.cc +0 -200
  390. package/build/_deps/benchmark-src/src/colorprint.h +0 -33
  391. package/build/_deps/benchmark-src/src/commandlineflags.cc +0 -298
  392. package/build/_deps/benchmark-src/src/commandlineflags.h +0 -133
  393. package/build/_deps/benchmark-src/src/complexity.cc +0 -244
  394. package/build/_deps/benchmark-src/src/complexity.h +0 -55
  395. package/build/_deps/benchmark-src/src/console_reporter.cc +0 -206
  396. package/build/_deps/benchmark-src/src/counter.cc +0 -80
  397. package/build/_deps/benchmark-src/src/counter.h +0 -32
  398. package/build/_deps/benchmark-src/src/csv_reporter.cc +0 -161
  399. package/build/_deps/benchmark-src/src/cycleclock.h +0 -230
  400. package/build/_deps/benchmark-src/src/internal_macros.h +0 -115
  401. package/build/_deps/benchmark-src/src/json_reporter.cc +0 -320
  402. package/build/_deps/benchmark-src/src/log.h +0 -88
  403. package/build/_deps/benchmark-src/src/mutex.h +0 -155
  404. package/build/_deps/benchmark-src/src/perf_counters.cc +0 -282
  405. package/build/_deps/benchmark-src/src/perf_counters.h +0 -200
  406. package/build/_deps/benchmark-src/src/re.h +0 -158
  407. package/build/_deps/benchmark-src/src/reporter.cc +0 -118
  408. package/build/_deps/benchmark-src/src/statistics.cc +0 -209
  409. package/build/_deps/benchmark-src/src/statistics.h +0 -44
  410. package/build/_deps/benchmark-src/src/string_util.cc +0 -254
  411. package/build/_deps/benchmark-src/src/string_util.h +0 -70
  412. package/build/_deps/benchmark-src/src/sysinfo.cc +0 -855
  413. package/build/_deps/benchmark-src/src/thread_manager.h +0 -63
  414. package/build/_deps/benchmark-src/src/thread_timer.h +0 -86
  415. package/build/_deps/benchmark-src/src/timers.cc +0 -272
  416. package/build/_deps/benchmark-src/src/timers.h +0 -48
  417. package/build/_deps/benchmark-src/test/AssemblyTests.cmake +0 -67
  418. package/build/_deps/benchmark-src/test/BUILD +0 -127
  419. package/build/_deps/benchmark-src/test/CMakeLists.txt +0 -309
  420. package/build/_deps/benchmark-src/test/args_product_test.cc +0 -77
  421. package/build/_deps/benchmark-src/test/basic_test.cc +0 -180
  422. package/build/_deps/benchmark-src/test/benchmark_gtest.cc +0 -169
  423. package/build/_deps/benchmark-src/test/benchmark_min_time_flag_iters_test.cc +0 -66
  424. package/build/_deps/benchmark-src/test/benchmark_min_time_flag_time_test.cc +0 -90
  425. package/build/_deps/benchmark-src/test/benchmark_name_gtest.cc +0 -82
  426. package/build/_deps/benchmark-src/test/benchmark_random_interleaving_gtest.cc +0 -126
  427. package/build/_deps/benchmark-src/test/benchmark_setup_teardown_test.cc +0 -157
  428. package/build/_deps/benchmark-src/test/benchmark_test.cc +0 -274
  429. package/build/_deps/benchmark-src/test/clobber_memory_assembly_test.cc +0 -64
  430. package/build/_deps/benchmark-src/test/commandlineflags_gtest.cc +0 -228
  431. package/build/_deps/benchmark-src/test/complexity_test.cc +0 -228
  432. package/build/_deps/benchmark-src/test/cxx03_test.cc +0 -62
  433. package/build/_deps/benchmark-src/test/diagnostics_test.cc +0 -91
  434. package/build/_deps/benchmark-src/test/display_aggregates_only_test.cc +0 -45
  435. package/build/_deps/benchmark-src/test/donotoptimize_assembly_test.cc +0 -201
  436. package/build/_deps/benchmark-src/test/donotoptimize_test.cc +0 -69
  437. package/build/_deps/benchmark-src/test/filter_test.cc +0 -117
  438. package/build/_deps/benchmark-src/test/fixture_test.cc +0 -51
  439. package/build/_deps/benchmark-src/test/internal_threading_test.cc +0 -185
  440. package/build/_deps/benchmark-src/test/link_main_test.cc +0 -9
  441. package/build/_deps/benchmark-src/test/map_test.cc +0 -59
  442. package/build/_deps/benchmark-src/test/memory_manager_test.cc +0 -47
  443. package/build/_deps/benchmark-src/test/min_time_parse_gtest.cc +0 -30
  444. package/build/_deps/benchmark-src/test/multiple_ranges_test.cc +0 -96
  445. package/build/_deps/benchmark-src/test/options_test.cc +0 -77
  446. package/build/_deps/benchmark-src/test/output_test.h +0 -211
  447. package/build/_deps/benchmark-src/test/output_test_helper.cc +0 -519
  448. package/build/_deps/benchmark-src/test/perf_counters_gtest.cc +0 -307
  449. package/build/_deps/benchmark-src/test/perf_counters_test.cc +0 -92
  450. package/build/_deps/benchmark-src/test/register_benchmark_test.cc +0 -196
  451. package/build/_deps/benchmark-src/test/repetitions_test.cc +0 -214
  452. package/build/_deps/benchmark-src/test/report_aggregates_only_test.cc +0 -41
  453. package/build/_deps/benchmark-src/test/reporter_output_test.cc +0 -1130
  454. package/build/_deps/benchmark-src/test/skip_with_error_test.cc +0 -199
  455. package/build/_deps/benchmark-src/test/spec_arg_test.cc +0 -105
  456. package/build/_deps/benchmark-src/test/spec_arg_verbosity_test.cc +0 -43
  457. package/build/_deps/benchmark-src/test/state_assembly_test.cc +0 -68
  458. package/build/_deps/benchmark-src/test/statistics_gtest.cc +0 -35
  459. package/build/_deps/benchmark-src/test/string_util_gtest.cc +0 -199
  460. package/build/_deps/benchmark-src/test/templated_fixture_test.cc +0 -28
  461. package/build/_deps/benchmark-src/test/time_unit_gtest.cc +0 -37
  462. package/build/_deps/benchmark-src/test/user_counters_tabular_test.cc +0 -558
  463. package/build/_deps/benchmark-src/test/user_counters_test.cc +0 -561
  464. package/build/_deps/benchmark-src/test/user_counters_thousands_test.cc +0 -186
  465. package/build/_deps/benchmark-src/tools/BUILD.bazel +0 -19
  466. package/build/_deps/benchmark-src/tools/compare.py +0 -432
  467. package/build/_deps/benchmark-src/tools/gbench/Inputs/test1_run1.json +0 -127
  468. package/build/_deps/benchmark-src/tools/gbench/Inputs/test1_run2.json +0 -127
  469. package/build/_deps/benchmark-src/tools/gbench/Inputs/test2_run.json +0 -81
  470. package/build/_deps/benchmark-src/tools/gbench/Inputs/test3_run0.json +0 -65
  471. package/build/_deps/benchmark-src/tools/gbench/Inputs/test3_run1.json +0 -65
  472. package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run.json +0 -96
  473. package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run0.json +0 -21
  474. package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run1.json +0 -21
  475. package/build/_deps/benchmark-src/tools/gbench/__init__.py +0 -8
  476. package/build/_deps/benchmark-src/tools/gbench/report.py +0 -1201
  477. package/build/_deps/benchmark-src/tools/gbench/util.py +0 -203
  478. package/build/_deps/benchmark-src/tools/libpfm.BUILD.bazel +0 -22
  479. package/build/_deps/benchmark-src/tools/requirements.txt +0 -2
  480. package/build/_deps/benchmark-src/tools/strip_asm.py +0 -151
  481. package/build/_deps/benchmark-subbuild/CMakeCache.txt +0 -133
  482. package/build/_deps/benchmark-subbuild/CMakeFiles/4.0.3/CMakeSystem.cmake +0 -15
  483. package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeConfigureLog.yaml +0 -11
  484. package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  485. package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeRuleHashes.txt +0 -11
  486. package/build/_deps/benchmark-subbuild/CMakeFiles/InstallScripts.json +0 -7
  487. package/build/_deps/benchmark-subbuild/CMakeFiles/Makefile.cmake +0 -52
  488. package/build/_deps/benchmark-subbuild/CMakeFiles/Makefile2 +0 -122
  489. package/build/_deps/benchmark-subbuild/CMakeFiles/TargetDirectories.txt +0 -3
  490. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate-complete +0 -0
  491. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/DependInfo.cmake +0 -22
  492. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/Labels.json +0 -46
  493. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/Labels.txt +0 -14
  494. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/build.make +0 -162
  495. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/cmake_clean.cmake +0 -17
  496. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/compiler_depend.make +0 -2
  497. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/compiler_depend.ts +0 -2
  498. package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/progress.make +0 -10
  499. package/build/_deps/benchmark-subbuild/CMakeFiles/cmake.check_cache +0 -1
  500. package/build/_deps/benchmark-subbuild/CMakeFiles/progress.marks +0 -1
  501. package/build/_deps/benchmark-subbuild/CMakeLists.txt +0 -42
  502. package/build/_deps/benchmark-subbuild/Makefile +0 -162
  503. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-build +0 -0
  504. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-configure +0 -0
  505. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-done +0 -0
  506. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-download +0 -0
  507. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-gitclone-lastrun.txt +0 -15
  508. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-gitinfo.txt +0 -15
  509. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-install +0 -0
  510. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-mkdir +0 -0
  511. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-patch +0 -0
  512. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-patch-info.txt +0 -6
  513. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-test +0 -0
  514. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-update-info.txt +0 -7
  515. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-cfgcmd.txt +0 -1
  516. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-gitclone.cmake +0 -87
  517. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-gitupdate.cmake +0 -317
  518. package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-mkdirs.cmake +0 -27
  519. package/build/_deps/benchmark-subbuild/cmake_install.cmake +0 -56
  520. package/build/bin/avl-rb-range-search-benchmark +0 -0
  521. package/build/bin/avl-tree-benchmark +0 -0
  522. package/build/bin/deque-benchmark +0 -0
  523. package/build/bin/doubly-linked-list-benchmark +0 -0
  524. package/build/bin/hash-map-benchmark +0 -0
  525. package/build/bin/heap-benchmark +0 -0
  526. package/build/bin/priority-queue-benchmark +0 -0
  527. package/build/bin/queue-benchmark +0 -0
  528. package/build/bin/red-black-tree-benchmark +0 -0
  529. package/build/bin/singly-linked-list-benchmark +0 -0
  530. package/build/bin/stack-benchmark +0 -0
  531. package/build/bin/tree-map-benchmark +0 -0
  532. package/build/bin/tree-multi-map-benchmark +0 -0
  533. package/build/bin/tree-multi-set-benchmark +0 -0
  534. package/build/bin/tree-set-benchmark +0 -0
  535. package/build/cmake_install.cmake +0 -66
  536. package/dist/cjs/index.cjs.map +0 -1
  537. package/dist/cjs-legacy/index.cjs.map +0 -1
  538. package/dist/esm/index.mjs.map +0 -1
  539. package/dist/esm-legacy/index.mjs.map +0 -1
  540. package/dist/umd/data-structure-typed.js.map +0 -1
  541. package/dist/umd/data-structure-typed.min.js.map +0 -1
  542. package/eslint.config.mjs +0 -73
  543. package/test/config.ts +0 -4
  544. package/test/integration/all-in-one.test.ts +0 -110
  545. package/test/integration/avl-tree.test.ts +0 -127
  546. package/test/integration/bst.test.ts +0 -385
  547. package/test/integration/compile.test.mjs +0 -159
  548. package/test/integration/compile.test.ts +0 -176
  549. package/test/integration/heap.test.js +0 -21
  550. package/test/integration/index.html +0 -462
  551. package/test/performance/benchmark-runner-enhanced.mjs +0 -818
  552. package/test/performance/cmake-benchmark-runner.mjs +0 -234
  553. package/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp +0 -112
  554. package/test/performance/data-structures/binary-tree/avl-rb-range-search.test.mjs +0 -51
  555. package/test/performance/data-structures/binary-tree/avl-tree.test.cpp +0 -181
  556. package/test/performance/data-structures/binary-tree/avl-tree.test.mjs +0 -138
  557. package/test/performance/data-structures/binary-tree/binary-tree-overall.test.mjs +0 -85
  558. package/test/performance/data-structures/binary-tree/binary-tree.test.mjs +0 -100
  559. package/test/performance/data-structures/binary-tree/bst.test.mjs +0 -61
  560. package/test/performance/data-structures/binary-tree/red-black-tree-cjs.test.mjs +0 -259
  561. package/test/performance/data-structures/binary-tree/red-black-tree.test.cpp +0 -213
  562. package/test/performance/data-structures/binary-tree/red-black-tree.test.mjs +0 -275
  563. package/test/performance/data-structures/binary-tree/tree-map.test.cpp +0 -129
  564. package/test/performance/data-structures/binary-tree/tree-map.test.mjs +0 -171
  565. package/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp +0 -205
  566. package/test/performance/data-structures/binary-tree/tree-multi-map.test.mjs +0 -106
  567. package/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp +0 -217
  568. package/test/performance/data-structures/binary-tree/tree-multi-set.test.mjs +0 -91
  569. package/test/performance/data-structures/binary-tree/tree-set.test.cpp +0 -127
  570. package/test/performance/data-structures/binary-tree/tree-set.test.mjs +0 -174
  571. package/test/performance/data-structures/comparison/comparison.test.mjs +0 -99
  572. package/test/performance/data-structures/graph/directed-graph.test.mjs +0 -38
  573. package/test/performance/data-structures/hash/hash-map.test.cpp +0 -183
  574. package/test/performance/data-structures/hash/hash-map.test.mjs +0 -187
  575. package/test/performance/data-structures/heap/heap.test.cpp +0 -61
  576. package/test/performance/data-structures/heap/heap.test.mjs +0 -31
  577. package/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp +0 -84
  578. package/test/performance/data-structures/linked-list/doubly-linked-list.test.mjs +0 -125
  579. package/test/performance/data-structures/linked-list/singly-linked-list.test.cpp +0 -77
  580. package/test/performance/data-structures/linked-list/singly-linked-list.test.mjs +0 -84
  581. package/test/performance/data-structures/priority-queue/max-priority-queue.test.mjs +0 -40
  582. package/test/performance/data-structures/priority-queue/priority-queue.test.cpp +0 -59
  583. package/test/performance/data-structures/priority-queue/priority-queue.test.mjs +0 -64
  584. package/test/performance/data-structures/queue/deque.test.cpp +0 -119
  585. package/test/performance/data-structures/queue/deque.test.mjs +0 -144
  586. package/test/performance/data-structures/queue/queue.test.cpp +0 -59
  587. package/test/performance/data-structures/queue/queue.test.mjs +0 -77
  588. package/test/performance/data-structures/stack/stack.test.cpp +0 -40
  589. package/test/performance/data-structures/stack/stack.test.mjs +0 -69
  590. package/test/performance/data-structures/trie/trie.test.mjs +0 -43
  591. package/test/performance/reportor-enhanced.mjs +0 -871
  592. package/test/performance/runner-config.json +0 -51
  593. package/test/types/index.ts +0 -1
  594. package/test/types/utils/big-o.ts +0 -1
  595. package/test/types/utils/index.ts +0 -2
  596. package/test/types/utils/json2html.ts +0 -5
  597. package/test/unit/data-structures/base/iterable-element-base.coverage.test.ts +0 -106
  598. package/test/unit/data-structures/base/iterable-element-base.more-branches.coverage.test.ts +0 -61
  599. package/test/unit/data-structures/base/linear-base.array.coverage.test.ts +0 -168
  600. package/test/unit/data-structures/base/linear-base.concat-else.coverage.test.ts +0 -82
  601. package/test/unit/data-structures/base/linear-base.coverage.test.ts +0 -72
  602. package/test/unit/data-structures/base/linear-base.more-branches.coverage.test.ts +0 -414
  603. package/test/unit/data-structures/binary-tree/avl-tree-node.familyPosition-root-left.coverage.test.ts +0 -17
  604. package/test/unit/data-structures/binary-tree/avl-tree.more-branches-2.coverage.test.ts +0 -99
  605. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +0 -729
  606. package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +0 -345
  607. package/test/unit/data-structures/binary-tree/binary-indexed-tree.more-branches.coverage.test.ts +0 -18
  608. package/test/unit/data-structures/binary-tree/binary-tree.more-branches.coverage.test.ts +0 -56
  609. package/test/unit/data-structures/binary-tree/binary-tree.remaining-branches.coverage.test.ts +0 -232
  610. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +0 -1912
  611. package/test/unit/data-structures/binary-tree/bst.bound-by-predicate.coverage.test.ts +0 -33
  612. package/test/unit/data-structures/binary-tree/bst.coverage.test.ts +0 -94
  613. package/test/unit/data-structures/binary-tree/bst.deletebykey.coverage.test.ts +0 -70
  614. package/test/unit/data-structures/binary-tree/bst.deletewhere.coverage.test.ts +0 -37
  615. package/test/unit/data-structures/binary-tree/bst.floor-lower-predicate.coverage.test.ts +0 -29
  616. package/test/unit/data-structures/binary-tree/bst.floor-setmany.coverage.test.ts +0 -72
  617. package/test/unit/data-structures/binary-tree/bst.getnode.range-ensure.coverage.test.ts +0 -22
  618. package/test/unit/data-structures/binary-tree/bst.misc-branches.coverage.test.ts +0 -100
  619. package/test/unit/data-structures/binary-tree/bst.more-branches-2.coverage.test.ts +0 -133
  620. package/test/unit/data-structures/binary-tree/bst.more-branches-3.coverage.test.ts +0 -45
  621. package/test/unit/data-structures/binary-tree/bst.more-branches-4.coverage.test.ts +0 -36
  622. package/test/unit/data-structures/binary-tree/bst.more-branches-5.coverage.test.ts +0 -40
  623. package/test/unit/data-structures/binary-tree/bst.more.coverage.test.ts +0 -39
  624. package/test/unit/data-structures/binary-tree/bst.node-family.coverage.test.ts +0 -29
  625. package/test/unit/data-structures/binary-tree/bst.range-pruning.coverage.test.ts +0 -43
  626. package/test/unit/data-structures/binary-tree/bst.search-fastpath.coverage.test.ts +0 -30
  627. package/test/unit/data-structures/binary-tree/bst.test.ts +0 -3472
  628. package/test/unit/data-structures/binary-tree/data/cost-of-living-by-country.ts +0 -259
  629. package/test/unit/data-structures/binary-tree/overall.test.ts +0 -219
  630. package/test/unit/data-structures/binary-tree/red-black-tree.boundary-corruption-repair.coverage.test.ts +0 -66
  631. package/test/unit/data-structures/binary-tree/red-black-tree.boundary-max-update.coverage.test.ts +0 -18
  632. package/test/unit/data-structures/binary-tree/red-black-tree.boundary-null.coverage.test.ts +0 -53
  633. package/test/unit/data-structures/binary-tree/red-black-tree.boundary-stale-cache.coverage.test.ts +0 -25
  634. package/test/unit/data-structures/binary-tree/red-black-tree.boundary-update.coverage.test.ts +0 -23
  635. package/test/unit/data-structures/binary-tree/red-black-tree.cache-delete.coverage.test.ts +0 -49
  636. package/test/unit/data-structures/binary-tree/red-black-tree.cache-edge.coverage.test.ts +0 -37
  637. package/test/unit/data-structures/binary-tree/red-black-tree.cache-stale-insert.coverage.test.ts +0 -39
  638. package/test/unit/data-structures/binary-tree/red-black-tree.coverage.test.ts +0 -334
  639. package/test/unit/data-structures/binary-tree/red-black-tree.delete-fixup.coverage.test.ts +0 -68
  640. package/test/unit/data-structures/binary-tree/red-black-tree.delete-successor.coverage.test.ts +0 -75
  641. package/test/unit/data-structures/binary-tree/red-black-tree.factories.coverage.test.ts +0 -26
  642. package/test/unit/data-structures/binary-tree/red-black-tree.hint-cache-compare-update.coverage.test.ts +0 -74
  643. package/test/unit/data-structures/binary-tree/red-black-tree.hint-cache-no-update.coverage.test.ts +0 -44
  644. package/test/unit/data-structures/binary-tree/red-black-tree.hint-cache-nullish.coverage.test.ts +0 -61
  645. package/test/unit/data-structures/binary-tree/red-black-tree.hint-mapmode-defined.coverage.test.ts +0 -35
  646. package/test/unit/data-structures/binary-tree/red-black-tree.hint-mapmode-undefined.coverage.test.ts +0 -43
  647. package/test/unit/data-structures/binary-tree/red-black-tree.hint-more.coverage.test.ts +0 -99
  648. package/test/unit/data-structures/binary-tree/red-black-tree.hint.coverage.test.ts +0 -60
  649. package/test/unit/data-structures/binary-tree/red-black-tree.insert-cache-nullish.coverage.test.ts +0 -29
  650. package/test/unit/data-structures/binary-tree/red-black-tree.insert-header-parent-nullish.coverage.test.ts +0 -17
  651. package/test/unit/data-structures/binary-tree/red-black-tree.internal-walk.coverage.test.ts +0 -57
  652. package/test/unit/data-structures/binary-tree/red-black-tree.minmax-cache.test.ts +0 -65
  653. package/test/unit/data-structures/binary-tree/red-black-tree.misc-inputs.coverage.test.ts +0 -17
  654. package/test/unit/data-structures/binary-tree/red-black-tree.more-branches-2.coverage.test.ts +0 -121
  655. package/test/unit/data-structures/binary-tree/red-black-tree.more-branches-3.coverage.test.ts +0 -55
  656. package/test/unit/data-structures/binary-tree/red-black-tree.more-branches-4.coverage.test.ts +0 -44
  657. package/test/unit/data-structures/binary-tree/red-black-tree.predsucc.coverage.test.ts +0 -40
  658. package/test/unit/data-structures/binary-tree/red-black-tree.remaining-branches.coverage.test.ts +0 -123
  659. package/test/unit/data-structures/binary-tree/red-black-tree.set-inputs.coverage.test.ts +0 -64
  660. package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-parent-cache.coverage.test.ts +0 -79
  661. package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-remaining.coverage.test.ts +0 -44
  662. package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-uncovered.coverage.test.ts +0 -74
  663. package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +0 -936
  664. package/test/unit/data-structures/binary-tree/red-black-tree.update-branches.coverage.test.ts +0 -30
  665. package/test/unit/data-structures/binary-tree/segment-tree.more-branches.coverage.test.ts +0 -31
  666. package/test/unit/data-structures/binary-tree/segment-tree.test.ts +0 -104
  667. package/test/unit/data-structures/binary-tree/tree-map.test.ts +0 -270
  668. package/test/unit/data-structures/binary-tree/tree-multi-map.coverage.test.ts +0 -245
  669. package/test/unit/data-structures/binary-tree/tree-multi-map.legacy.test.ts.skip +0 -1115
  670. package/test/unit/data-structures/binary-tree/tree-multi-map.more-branches-2.coverage.test.ts.skip +0 -59
  671. package/test/unit/data-structures/binary-tree/tree-multi-map.rfc.test.ts +0 -99
  672. package/test/unit/data-structures/binary-tree/tree-multi-map.simplified.test.ts +0 -482
  673. package/test/unit/data-structures/binary-tree/tree-multi-set.test.ts +0 -545
  674. package/test/unit/data-structures/binary-tree/tree-set.test.ts +0 -187
  675. package/test/unit/data-structures/graph/abstract-graph.more-branches-2.coverage.test.ts +0 -40
  676. package/test/unit/data-structures/graph/abstract-graph.more-branches-3.coverage.test.ts +0 -65
  677. package/test/unit/data-structures/graph/abstract-graph.more-branches-4.coverage.test.ts +0 -98
  678. package/test/unit/data-structures/graph/abstract-graph.more-branches-5.coverage.test.ts +0 -51
  679. package/test/unit/data-structures/graph/abstract-graph.more-branches.coverage.test.ts +0 -62
  680. package/test/unit/data-structures/graph/abstract-graph.test.ts +0 -117
  681. package/test/unit/data-structures/graph/directed-graph.more-branches-2.coverage.test.ts +0 -38
  682. package/test/unit/data-structures/graph/directed-graph.more-branches-3.coverage.test.ts +0 -25
  683. package/test/unit/data-structures/graph/directed-graph.more-branches.coverage.test.ts +0 -82
  684. package/test/unit/data-structures/graph/directed-graph.test.ts +0 -1185
  685. package/test/unit/data-structures/graph/map-graph.more-branches.coverage.test.ts +0 -22
  686. package/test/unit/data-structures/graph/map-graph.test.ts +0 -148
  687. package/test/unit/data-structures/graph/overall.test.ts +0 -49
  688. package/test/unit/data-structures/graph/salty-edges.json +0 -875
  689. package/test/unit/data-structures/graph/salty-vertexes.json +0 -200
  690. package/test/unit/data-structures/graph/undirected-graph.more-branches-2.coverage.test.ts +0 -35
  691. package/test/unit/data-structures/graph/undirected-graph.more-branches.coverage.test.ts +0 -87
  692. package/test/unit/data-structures/graph/undirected-graph.test.ts +0 -782
  693. package/test/unit/data-structures/hash/hash-map.more-branches.coverage.test.ts +0 -64
  694. package/test/unit/data-structures/hash/hash-map.test.ts +0 -1125
  695. package/test/unit/data-structures/hash/hash-map.toEntryFn-branch.coverage.test.ts +0 -9
  696. package/test/unit/data-structures/heap/heap.misc-branches.coverage.test.ts +0 -110
  697. package/test/unit/data-structures/heap/heap.remaining-branches.coverage.test.ts +0 -22
  698. package/test/unit/data-structures/heap/heap.test.ts +0 -760
  699. package/test/unit/data-structures/heap/max-heap.coverage.test.ts +0 -29
  700. package/test/unit/data-structures/heap/max-heap.test.ts +0 -98
  701. package/test/unit/data-structures/heap/min-heap.test.ts +0 -117
  702. package/test/unit/data-structures/linked-list/doubly-linked-list.more-branches.coverage.test.ts +0 -72
  703. package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +0 -1150
  704. package/test/unit/data-structures/linked-list/linked-list.test.ts +0 -8
  705. package/test/unit/data-structures/linked-list/linked-list.unshiftMany-else.coverage.test.ts +0 -15
  706. package/test/unit/data-structures/linked-list/singly-linked-list.coverage.test.ts +0 -221
  707. package/test/unit/data-structures/linked-list/singly-linked-list.more-branches.coverage.test.ts +0 -86
  708. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +0 -836
  709. package/test/unit/data-structures/linked-list/skip-linked-list.more-branches.coverage.test.ts +0 -31
  710. package/test/unit/data-structures/linked-list/skip-linked-list.test.ts +0 -13
  711. package/test/unit/data-structures/linked-list/skip-list.test.ts +0 -86
  712. package/test/unit/data-structures/matrix/matrix.more-branches.coverage.test.ts +0 -81
  713. package/test/unit/data-structures/matrix/matrix.pivotElement-nullish.coverage.test.ts +0 -28
  714. package/test/unit/data-structures/matrix/matrix.test.ts +0 -377
  715. package/test/unit/data-structures/matrix/navigator.test.ts +0 -244
  716. package/test/unit/data-structures/priority-queue/max-priority-queue.more-branches.coverage.test.ts +0 -10
  717. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +0 -160
  718. package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +0 -78
  719. package/test/unit/data-structures/priority-queue/priority-queue.coverage.test.ts +0 -21
  720. package/test/unit/data-structures/priority-queue/priority-queue.test.ts +0 -101
  721. package/test/unit/data-structures/queue/deque.coverage.test.ts +0 -173
  722. package/test/unit/data-structures/queue/deque.more-branches-2.coverage.test.ts +0 -39
  723. package/test/unit/data-structures/queue/deque.more-branches-3.coverage.test.ts +0 -9
  724. package/test/unit/data-structures/queue/deque.more-branches.coverage.test.ts +0 -95
  725. package/test/unit/data-structures/queue/deque.test.ts +0 -936
  726. package/test/unit/data-structures/queue/queue.coverage.test.ts +0 -138
  727. package/test/unit/data-structures/queue/queue.more-branches-2.coverage.test.ts +0 -27
  728. package/test/unit/data-structures/queue/queue.test.ts +0 -703
  729. package/test/unit/data-structures/stack/stack.coverage.test.ts +0 -112
  730. package/test/unit/data-structures/stack/stack.test.ts +0 -438
  731. package/test/unit/data-structures/tree/tree.more-branches.coverage.test.ts +0 -9
  732. package/test/unit/data-structures/tree/tree.test.ts +0 -58
  733. package/test/unit/data-structures/trie/trie.more-branches-2.coverage.test.ts +0 -51
  734. package/test/unit/data-structures/trie/trie.test.ts +0 -1181
  735. package/test/unit/unrestricted-interconversion.test.ts +0 -299
  736. package/test/unit/utils/utils.test.ts +0 -174
  737. package/test/utils/array.ts +0 -5517
  738. package/test/utils/big-o.ts +0 -228
  739. package/test/utils/console.ts +0 -31
  740. package/test/utils/index.ts +0 -8
  741. package/test/utils/is.ts +0 -56
  742. package/test/utils/json2html.ts +0 -164
  743. package/test/utils/number.ts +0 -13
  744. package/test/utils/patch.ts +0 -33
  745. package/test/utils/perf.mjs +0 -34
  746. package/test/utils/performanc.ts +0 -7
  747. package/test/utils/string.ts +0 -49
  748. package/tsconfig.types.json +0 -15
  749. package/tsup.config.js +0 -63
  750. package/tsup.umd.config.js +0 -29
@@ -1,1266 +0,0 @@
1
- # User Guide
2
-
3
- ## Command Line
4
-
5
- [Output Formats](#output-formats)
6
-
7
- [Output Files](#output-files)
8
-
9
- [Running Benchmarks](#running-benchmarks)
10
-
11
- [Running a Subset of Benchmarks](#running-a-subset-of-benchmarks)
12
-
13
- [Result Comparison](#result-comparison)
14
-
15
- [Extra Context](#extra-context)
16
-
17
- ## Library
18
-
19
- [Runtime and Reporting Considerations](#runtime-and-reporting-considerations)
20
-
21
- [Setup/Teardown](#setupteardown)
22
-
23
- [Passing Arguments](#passing-arguments)
24
-
25
- [Custom Benchmark Name](#custom-benchmark-name)
26
-
27
- [Calculating Asymptotic Complexity](#asymptotic-complexity)
28
-
29
- [Templated Benchmarks](#templated-benchmarks)
30
-
31
- [Fixtures](#fixtures)
32
-
33
- [Custom Counters](#custom-counters)
34
-
35
- [Multithreaded Benchmarks](#multithreaded-benchmarks)
36
-
37
- [CPU Timers](#cpu-timers)
38
-
39
- [Manual Timing](#manual-timing)
40
-
41
- [Setting the Time Unit](#setting-the-time-unit)
42
-
43
- [Random Interleaving](random_interleaving.md)
44
-
45
- [User-Requested Performance Counters](perf_counters.md)
46
-
47
- [Preventing Optimization](#preventing-optimization)
48
-
49
- [Reporting Statistics](#reporting-statistics)
50
-
51
- [Custom Statistics](#custom-statistics)
52
-
53
- [Memory Usage](#memory-usage)
54
-
55
- [Using RegisterBenchmark](#using-register-benchmark)
56
-
57
- [Exiting with an Error](#exiting-with-an-error)
58
-
59
- [A Faster `KeepRunning` Loop](#a-faster-keep-running-loop)
60
-
61
- ## Benchmarking Tips
62
-
63
- [Disabling CPU Frequency Scaling](#disabling-cpu-frequency-scaling)
64
-
65
- [Reducing Variance in Benchmarks](reducing_variance.md)
66
-
67
- <a name="output-formats" />
68
-
69
- ## Output Formats
70
-
71
- The library supports multiple output formats. Use the
72
- `--benchmark_format=<console|json|csv>` flag (or set the
73
- `BENCHMARK_FORMAT=<console|json|csv>` environment variable) to set
74
- the format type. `console` is the default format.
75
-
76
- The Console format is intended to be a human readable format. By default
77
- the format generates color output. Context is output on stderr and the
78
- tabular data on stdout. Example tabular output looks like:
79
-
80
- ```
81
- Benchmark Time(ns) CPU(ns) Iterations
82
- ----------------------------------------------------------------------
83
- BM_SetInsert/1024/1 28928 29349 23853 133.097kB/s 33.2742k items/s
84
- BM_SetInsert/1024/8 32065 32913 21375 949.487kB/s 237.372k items/s
85
- BM_SetInsert/1024/10 33157 33648 21431 1.13369MB/s 290.225k items/s
86
- ```
87
-
88
- The JSON format outputs human readable json split into two top level attributes.
89
- The `context` attribute contains information about the run in general, including
90
- information about the CPU and the date.
91
- The `benchmarks` attribute contains a list of every benchmark run. Example json
92
- output looks like:
93
-
94
- ```json
95
- {
96
- "context": {
97
- "date": "2015/03/17-18:40:25",
98
- "num_cpus": 40,
99
- "mhz_per_cpu": 2801,
100
- "cpu_scaling_enabled": false,
101
- "build_type": "debug"
102
- },
103
- "benchmarks": [
104
- {
105
- "name": "BM_SetInsert/1024/1",
106
- "iterations": 94877,
107
- "real_time": 29275,
108
- "cpu_time": 29836,
109
- "bytes_per_second": 134066,
110
- "items_per_second": 33516
111
- },
112
- {
113
- "name": "BM_SetInsert/1024/8",
114
- "iterations": 21609,
115
- "real_time": 32317,
116
- "cpu_time": 32429,
117
- "bytes_per_second": 986770,
118
- "items_per_second": 246693
119
- },
120
- {
121
- "name": "BM_SetInsert/1024/10",
122
- "iterations": 21393,
123
- "real_time": 32724,
124
- "cpu_time": 33355,
125
- "bytes_per_second": 1199226,
126
- "items_per_second": 299807
127
- }
128
- ]
129
- }
130
- ```
131
-
132
- The CSV format outputs comma-separated values. The `context` is output on stderr
133
- and the CSV itself on stdout. Example CSV output looks like:
134
-
135
- ```
136
- name,iterations,real_time,cpu_time,bytes_per_second,items_per_second,label
137
- "BM_SetInsert/1024/1",65465,17890.7,8407.45,475768,118942,
138
- "BM_SetInsert/1024/8",116606,18810.1,9766.64,3.27646e+06,819115,
139
- "BM_SetInsert/1024/10",106365,17238.4,8421.53,4.74973e+06,1.18743e+06,
140
- ```
141
-
142
- <a name="output-files" />
143
-
144
- ## Output Files
145
-
146
- Write benchmark results to a file with the `--benchmark_out=<filename>` option
147
- (or set `BENCHMARK_OUT`). Specify the output format with
148
- `--benchmark_out_format={json|console|csv}` (or set
149
- `BENCHMARK_OUT_FORMAT={json|console|csv}`). Note that the 'csv' reporter is
150
- deprecated and the saved `.csv` file
151
- [is not parsable](https://github.com/google/benchmark/issues/794) by csv
152
- parsers.
153
-
154
- Specifying `--benchmark_out` does not suppress the console output.
155
-
156
- <a name="running-benchmarks" />
157
-
158
- ## Running Benchmarks
159
-
160
- Benchmarks are executed by running the produced binaries. Benchmarks binaries,
161
- by default, accept options that may be specified either through their command
162
- line interface or by setting environment variables before execution. For every
163
- `--option_flag=<value>` CLI switch, a corresponding environment variable
164
- `OPTION_FLAG=<value>` exist and is used as default if set (CLI switches always
165
- prevails). A complete list of CLI options is available running benchmarks
166
- with the `--help` switch.
167
-
168
- <a name="running-a-subset-of-benchmarks" />
169
-
170
- ## Running a Subset of Benchmarks
171
-
172
- The `--benchmark_filter=<regex>` option (or `BENCHMARK_FILTER=<regex>`
173
- environment variable) can be used to only run the benchmarks that match
174
- the specified `<regex>`. For example:
175
-
176
- ```bash
177
- $ ./run_benchmarks.x --benchmark_filter=BM_memcpy/32
178
- Run on (1 X 2300 MHz CPU )
179
- 2016-06-25 19:34:24
180
- Benchmark Time CPU Iterations
181
- ----------------------------------------------------
182
- BM_memcpy/32 11 ns 11 ns 79545455
183
- BM_memcpy/32k 2181 ns 2185 ns 324074
184
- BM_memcpy/32 12 ns 12 ns 54687500
185
- BM_memcpy/32k 1834 ns 1837 ns 357143
186
- ```
187
-
188
- ## Disabling Benchmarks
189
-
190
- It is possible to temporarily disable benchmarks by renaming the benchmark
191
- function to have the prefix "DISABLED_". This will cause the benchmark to
192
- be skipped at runtime.
193
-
194
- <a name="result-comparison" />
195
-
196
- ## Result comparison
197
-
198
- It is possible to compare the benchmarking results.
199
- See [Additional Tooling Documentation](tools.md)
200
-
201
- <a name="extra-context" />
202
-
203
- ## Extra Context
204
-
205
- Sometimes it's useful to add extra context to the content printed before the
206
- results. By default this section includes information about the CPU on which
207
- the benchmarks are running. If you do want to add more context, you can use
208
- the `benchmark_context` command line flag:
209
-
210
- ```bash
211
- $ ./run_benchmarks --benchmark_context=pwd=`pwd`
212
- Run on (1 x 2300 MHz CPU)
213
- pwd: /home/user/benchmark/
214
- Benchmark Time CPU Iterations
215
- ----------------------------------------------------
216
- BM_memcpy/32 11 ns 11 ns 79545455
217
- BM_memcpy/32k 2181 ns 2185 ns 324074
218
- ```
219
-
220
- You can get the same effect with the API:
221
-
222
- ```c++
223
- benchmark::AddCustomContext("foo", "bar");
224
- ```
225
-
226
- Note that attempts to add a second value with the same key will fail with an
227
- error message.
228
-
229
- <a name="runtime-and-reporting-considerations" />
230
-
231
- ## Runtime and Reporting Considerations
232
-
233
- When the benchmark binary is executed, each benchmark function is run serially.
234
- The number of iterations to run is determined dynamically by running the
235
- benchmark a few times and measuring the time taken and ensuring that the
236
- ultimate result will be statistically stable. As such, faster benchmark
237
- functions will be run for more iterations than slower benchmark functions, and
238
- the number of iterations is thus reported.
239
-
240
- In all cases, the number of iterations for which the benchmark is run is
241
- governed by the amount of time the benchmark takes. Concretely, the number of
242
- iterations is at least one, not more than 1e9, until CPU time is greater than
243
- the minimum time, or the wallclock time is 5x minimum time. The minimum time is
244
- set per benchmark by calling `MinTime` on the registered benchmark object.
245
-
246
- Furthermore warming up a benchmark might be necessary in order to get
247
- stable results because of e.g caching effects of the code under benchmark.
248
- Warming up means running the benchmark a given amount of time, before
249
- results are actually taken into account. The amount of time for which
250
- the warmup should be run can be set per benchmark by calling
251
- `MinWarmUpTime` on the registered benchmark object or for all benchmarks
252
- using the `--benchmark_min_warmup_time` command-line option. Note that
253
- `MinWarmUpTime` will overwrite the value of `--benchmark_min_warmup_time`
254
- for the single benchmark. How many iterations the warmup run of each
255
- benchmark takes is determined the same way as described in the paragraph
256
- above. Per default the warmup phase is set to 0 seconds and is therefore
257
- disabled.
258
-
259
- Average timings are then reported over the iterations run. If multiple
260
- repetitions are requested using the `--benchmark_repetitions` command-line
261
- option, or at registration time, the benchmark function will be run several
262
- times and statistical results across these repetitions will also be reported.
263
-
264
- As well as the per-benchmark entries, a preamble in the report will include
265
- information about the machine on which the benchmarks are run.
266
-
267
- <a name="setup-teardown" />
268
-
269
- ## Setup/Teardown
270
-
271
- Global setup/teardown specific to each benchmark can be done by
272
- passing a callback to Setup/Teardown:
273
-
274
- The setup/teardown callbacks will be invoked once for each benchmark. If the
275
- benchmark is multi-threaded (will run in k threads), they will be invoked
276
- exactly once before each run with k threads.
277
-
278
- If the benchmark uses different size groups of threads, the above will be true
279
- for each size group.
280
-
281
- Eg.,
282
-
283
- ```c++
284
- static void DoSetup(const benchmark::State& state) {
285
- }
286
-
287
- static void DoTeardown(const benchmark::State& state) {
288
- }
289
-
290
- static void BM_func(benchmark::State& state) {...}
291
-
292
- BENCHMARK(BM_func)->Arg(1)->Arg(3)->Threads(16)->Threads(32)->Setup(DoSetup)->Teardown(DoTeardown);
293
-
294
- ```
295
-
296
- In this example, `DoSetup` and `DoTearDown` will be invoked 4 times each,
297
- specifically, once for each of this family:
298
- - BM_func_Arg_1_Threads_16, BM_func_Arg_1_Threads_32
299
- - BM_func_Arg_3_Threads_16, BM_func_Arg_3_Threads_32
300
-
301
- <a name="passing-arguments" />
302
-
303
- ## Passing Arguments
304
-
305
- Sometimes a family of benchmarks can be implemented with just one routine that
306
- takes an extra argument to specify which one of the family of benchmarks to
307
- run. For example, the following code defines a family of benchmarks for
308
- measuring the speed of `memcpy()` calls of different lengths:
309
-
310
- ```c++
311
- static void BM_memcpy(benchmark::State& state) {
312
- char* src = new char[state.range(0)];
313
- char* dst = new char[state.range(0)];
314
- memset(src, 'x', state.range(0));
315
- for (auto _ : state)
316
- memcpy(dst, src, state.range(0));
317
- state.SetBytesProcessed(int64_t(state.iterations()) *
318
- int64_t(state.range(0)));
319
- delete[] src;
320
- delete[] dst;
321
- }
322
- BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(4<<10)->Arg(8<<10);
323
- ```
324
-
325
- The preceding code is quite repetitive, and can be replaced with the following
326
- short-hand. The following invocation will pick a few appropriate arguments in
327
- the specified range and will generate a benchmark for each such argument.
328
-
329
- ```c++
330
- BENCHMARK(BM_memcpy)->Range(8, 8<<10);
331
- ```
332
-
333
- By default the arguments in the range are generated in multiples of eight and
334
- the command above selects [ 8, 64, 512, 4k, 8k ]. In the following code the
335
- range multiplier is changed to multiples of two.
336
-
337
- ```c++
338
- BENCHMARK(BM_memcpy)->RangeMultiplier(2)->Range(8, 8<<10);
339
- ```
340
-
341
- Now arguments generated are [ 8, 16, 32, 64, 128, 256, 512, 1024, 2k, 4k, 8k ].
342
-
343
- The preceding code shows a method of defining a sparse range. The following
344
- example shows a method of defining a dense range. It is then used to benchmark
345
- the performance of `std::vector` initialization for uniformly increasing sizes.
346
-
347
- ```c++
348
- static void BM_DenseRange(benchmark::State& state) {
349
- for(auto _ : state) {
350
- std::vector<int> v(state.range(0), state.range(0));
351
- auto data = v.data();
352
- benchmark::DoNotOptimize(data);
353
- benchmark::ClobberMemory();
354
- }
355
- }
356
- BENCHMARK(BM_DenseRange)->DenseRange(0, 1024, 128);
357
- ```
358
-
359
- Now arguments generated are [ 0, 128, 256, 384, 512, 640, 768, 896, 1024 ].
360
-
361
- You might have a benchmark that depends on two or more inputs. For example, the
362
- following code defines a family of benchmarks for measuring the speed of set
363
- insertion.
364
-
365
- ```c++
366
- static void BM_SetInsert(benchmark::State& state) {
367
- std::set<int> data;
368
- for (auto _ : state) {
369
- state.PauseTiming();
370
- data = ConstructRandomSet(state.range(0));
371
- state.ResumeTiming();
372
- for (int j = 0; j < state.range(1); ++j)
373
- data.insert(RandomNumber());
374
- }
375
- }
376
- BENCHMARK(BM_SetInsert)
377
- ->Args({1<<10, 128})
378
- ->Args({2<<10, 128})
379
- ->Args({4<<10, 128})
380
- ->Args({8<<10, 128})
381
- ->Args({1<<10, 512})
382
- ->Args({2<<10, 512})
383
- ->Args({4<<10, 512})
384
- ->Args({8<<10, 512});
385
- ```
386
-
387
- The preceding code is quite repetitive, and can be replaced with the following
388
- short-hand. The following macro will pick a few appropriate arguments in the
389
- product of the two specified ranges and will generate a benchmark for each such
390
- pair.
391
-
392
- <!-- {% raw %} -->
393
- ```c++
394
- BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {128, 512}});
395
- ```
396
- <!-- {% endraw %} -->
397
-
398
- Some benchmarks may require specific argument values that cannot be expressed
399
- with `Ranges`. In this case, `ArgsProduct` offers the ability to generate a
400
- benchmark input for each combination in the product of the supplied vectors.
401
-
402
- <!-- {% raw %} -->
403
- ```c++
404
- BENCHMARK(BM_SetInsert)
405
- ->ArgsProduct({{1<<10, 3<<10, 8<<10}, {20, 40, 60, 80}})
406
- // would generate the same benchmark arguments as
407
- BENCHMARK(BM_SetInsert)
408
- ->Args({1<<10, 20})
409
- ->Args({3<<10, 20})
410
- ->Args({8<<10, 20})
411
- ->Args({3<<10, 40})
412
- ->Args({8<<10, 40})
413
- ->Args({1<<10, 40})
414
- ->Args({1<<10, 60})
415
- ->Args({3<<10, 60})
416
- ->Args({8<<10, 60})
417
- ->Args({1<<10, 80})
418
- ->Args({3<<10, 80})
419
- ->Args({8<<10, 80});
420
- ```
421
- <!-- {% endraw %} -->
422
-
423
- For the most common scenarios, helper methods for creating a list of
424
- integers for a given sparse or dense range are provided.
425
-
426
- ```c++
427
- BENCHMARK(BM_SetInsert)
428
- ->ArgsProduct({
429
- benchmark::CreateRange(8, 128, /*multi=*/2),
430
- benchmark::CreateDenseRange(1, 4, /*step=*/1)
431
- })
432
- // would generate the same benchmark arguments as
433
- BENCHMARK(BM_SetInsert)
434
- ->ArgsProduct({
435
- {8, 16, 32, 64, 128},
436
- {1, 2, 3, 4}
437
- });
438
- ```
439
-
440
- For more complex patterns of inputs, passing a custom function to `Apply` allows
441
- programmatic specification of an arbitrary set of arguments on which to run the
442
- benchmark. The following example enumerates a dense range on one parameter,
443
- and a sparse range on the second.
444
-
445
- ```c++
446
- static void CustomArguments(benchmark::internal::Benchmark* b) {
447
- for (int i = 0; i <= 10; ++i)
448
- for (int j = 32; j <= 1024*1024; j *= 8)
449
- b->Args({i, j});
450
- }
451
- BENCHMARK(BM_SetInsert)->Apply(CustomArguments);
452
- ```
453
-
454
- ### Passing Arbitrary Arguments to a Benchmark
455
-
456
- In C++11 it is possible to define a benchmark that takes an arbitrary number
457
- of extra arguments. The `BENCHMARK_CAPTURE(func, test_case_name, ...args)`
458
- macro creates a benchmark that invokes `func` with the `benchmark::State` as
459
- the first argument followed by the specified `args...`.
460
- The `test_case_name` is appended to the name of the benchmark and
461
- should describe the values passed.
462
-
463
- ```c++
464
- template <class ...Args>
465
- void BM_takes_args(benchmark::State& state, Args&&... args) {
466
- auto args_tuple = std::make_tuple(std::move(args)...);
467
- for (auto _ : state) {
468
- std::cout << std::get<0>(args_tuple) << ": " << std::get<1>(args_tuple)
469
- << '\n';
470
- [...]
471
- }
472
- }
473
- // Registers a benchmark named "BM_takes_args/int_string_test" that passes
474
- // the specified values to `args`.
475
- BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc"));
476
-
477
- // Registers the same benchmark "BM_takes_args/int_test" that passes
478
- // the specified values to `args`.
479
- BENCHMARK_CAPTURE(BM_takes_args, int_test, 42, 43);
480
- ```
481
-
482
- Note that elements of `...args` may refer to global variables. Users should
483
- avoid modifying global state inside of a benchmark.
484
-
485
- <a name="asymptotic-complexity" />
486
-
487
- ## Calculating Asymptotic Complexity (Big O)
488
-
489
- Asymptotic complexity might be calculated for a family of benchmarks. The
490
- following code will calculate the coefficient for the high-order term in the
491
- running time and the normalized root-mean square error of string comparison.
492
-
493
- ```c++
494
- static void BM_StringCompare(benchmark::State& state) {
495
- std::string s1(state.range(0), '-');
496
- std::string s2(state.range(0), '-');
497
- for (auto _ : state) {
498
- auto comparison_result = s1.compare(s2);
499
- benchmark::DoNotOptimize(comparison_result);
500
- }
501
- state.SetComplexityN(state.range(0));
502
- }
503
- BENCHMARK(BM_StringCompare)
504
- ->RangeMultiplier(2)->Range(1<<10, 1<<18)->Complexity(benchmark::oN);
505
- ```
506
-
507
- As shown in the following invocation, asymptotic complexity might also be
508
- calculated automatically.
509
-
510
- ```c++
511
- BENCHMARK(BM_StringCompare)
512
- ->RangeMultiplier(2)->Range(1<<10, 1<<18)->Complexity();
513
- ```
514
-
515
- The following code will specify asymptotic complexity with a lambda function,
516
- that might be used to customize high-order term calculation.
517
-
518
- ```c++
519
- BENCHMARK(BM_StringCompare)->RangeMultiplier(2)
520
- ->Range(1<<10, 1<<18)->Complexity([](benchmark::IterationCount n)->double{return n; });
521
- ```
522
-
523
- <a name="custom-benchmark-name" />
524
-
525
- ## Custom Benchmark Name
526
-
527
- You can change the benchmark's name as follows:
528
-
529
- ```c++
530
- BENCHMARK(BM_memcpy)->Name("memcpy")->RangeMultiplier(2)->Range(8, 8<<10);
531
- ```
532
-
533
- The invocation will execute the benchmark as before using `BM_memcpy` but changes
534
- the prefix in the report to `memcpy`.
535
-
536
- <a name="templated-benchmarks" />
537
-
538
- ## Templated Benchmarks
539
-
540
- This example produces and consumes messages of size `sizeof(v)` `range_x`
541
- times. It also outputs throughput in the absence of multiprogramming.
542
-
543
- ```c++
544
- template <class Q> void BM_Sequential(benchmark::State& state) {
545
- Q q;
546
- typename Q::value_type v;
547
- for (auto _ : state) {
548
- for (int i = state.range(0); i--; )
549
- q.push(v);
550
- for (int e = state.range(0); e--; )
551
- q.Wait(&v);
552
- }
553
- // actually messages, not bytes:
554
- state.SetBytesProcessed(
555
- static_cast<int64_t>(state.iterations())*state.range(0));
556
- }
557
- // C++03
558
- BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10);
559
-
560
- // C++11 or newer, you can use the BENCHMARK macro with template parameters:
561
- BENCHMARK(BM_Sequential<WaitQueue<int>>)->Range(1<<0, 1<<10);
562
-
563
- ```
564
-
565
- Three macros are provided for adding benchmark templates.
566
-
567
- ```c++
568
- #ifdef BENCHMARK_HAS_CXX11
569
- #define BENCHMARK(func<...>) // Takes any number of parameters.
570
- #else // C++ < C++11
571
- #define BENCHMARK_TEMPLATE(func, arg1)
572
- #endif
573
- #define BENCHMARK_TEMPLATE1(func, arg1)
574
- #define BENCHMARK_TEMPLATE2(func, arg1, arg2)
575
- ```
576
-
577
- <a name="fixtures" />
578
-
579
- ## Fixtures
580
-
581
- Fixture tests are created by first defining a type that derives from
582
- `::benchmark::Fixture` and then creating/registering the tests using the
583
- following macros:
584
-
585
- * `BENCHMARK_F(ClassName, Method)`
586
- * `BENCHMARK_DEFINE_F(ClassName, Method)`
587
- * `BENCHMARK_REGISTER_F(ClassName, Method)`
588
-
589
- For Example:
590
-
591
- ```c++
592
- class MyFixture : public benchmark::Fixture {
593
- public:
594
- void SetUp(const ::benchmark::State& state) {
595
- }
596
-
597
- void TearDown(const ::benchmark::State& state) {
598
- }
599
- };
600
-
601
- BENCHMARK_F(MyFixture, FooTest)(benchmark::State& st) {
602
- for (auto _ : st) {
603
- ...
604
- }
605
- }
606
-
607
- BENCHMARK_DEFINE_F(MyFixture, BarTest)(benchmark::State& st) {
608
- for (auto _ : st) {
609
- ...
610
- }
611
- }
612
- /* BarTest is NOT registered */
613
- BENCHMARK_REGISTER_F(MyFixture, BarTest)->Threads(2);
614
- /* BarTest is now registered */
615
- ```
616
-
617
- ### Templated Fixtures
618
-
619
- Also you can create templated fixture by using the following macros:
620
-
621
- * `BENCHMARK_TEMPLATE_F(ClassName, Method, ...)`
622
- * `BENCHMARK_TEMPLATE_DEFINE_F(ClassName, Method, ...)`
623
-
624
- For example:
625
-
626
- ```c++
627
- template<typename T>
628
- class MyFixture : public benchmark::Fixture {};
629
-
630
- BENCHMARK_TEMPLATE_F(MyFixture, IntTest, int)(benchmark::State& st) {
631
- for (auto _ : st) {
632
- ...
633
- }
634
- }
635
-
636
- BENCHMARK_TEMPLATE_DEFINE_F(MyFixture, DoubleTest, double)(benchmark::State& st) {
637
- for (auto _ : st) {
638
- ...
639
- }
640
- }
641
-
642
- BENCHMARK_REGISTER_F(MyFixture, DoubleTest)->Threads(2);
643
- ```
644
-
645
- <a name="custom-counters" />
646
-
647
- ## Custom Counters
648
-
649
- You can add your own counters with user-defined names. The example below
650
- will add columns "Foo", "Bar" and "Baz" in its output:
651
-
652
- ```c++
653
- static void UserCountersExample1(benchmark::State& state) {
654
- double numFoos = 0, numBars = 0, numBazs = 0;
655
- for (auto _ : state) {
656
- // ... count Foo,Bar,Baz events
657
- }
658
- state.counters["Foo"] = numFoos;
659
- state.counters["Bar"] = numBars;
660
- state.counters["Baz"] = numBazs;
661
- }
662
- ```
663
-
664
- The `state.counters` object is a `std::map` with `std::string` keys
665
- and `Counter` values. The latter is a `double`-like class, via an implicit
666
- conversion to `double&`. Thus you can use all of the standard arithmetic
667
- assignment operators (`=,+=,-=,*=,/=`) to change the value of each counter.
668
-
669
- In multithreaded benchmarks, each counter is set on the calling thread only.
670
- When the benchmark finishes, the counters from each thread will be summed;
671
- the resulting sum is the value which will be shown for the benchmark.
672
-
673
- The `Counter` constructor accepts three parameters: the value as a `double`
674
- ; a bit flag which allows you to show counters as rates, and/or as per-thread
675
- iteration, and/or as per-thread averages, and/or iteration invariants,
676
- and/or finally inverting the result; and a flag specifying the 'unit' - i.e.
677
- is 1k a 1000 (default, `benchmark::Counter::OneK::kIs1000`), or 1024
678
- (`benchmark::Counter::OneK::kIs1024`)?
679
-
680
- ```c++
681
- // sets a simple counter
682
- state.counters["Foo"] = numFoos;
683
-
684
- // Set the counter as a rate. It will be presented divided
685
- // by the duration of the benchmark.
686
- // Meaning: per one second, how many 'foo's are processed?
687
- state.counters["FooRate"] = Counter(numFoos, benchmark::Counter::kIsRate);
688
-
689
- // Set the counter as a rate. It will be presented divided
690
- // by the duration of the benchmark, and the result inverted.
691
- // Meaning: how many seconds it takes to process one 'foo'?
692
- state.counters["FooInvRate"] = Counter(numFoos, benchmark::Counter::kIsRate | benchmark::Counter::kInvert);
693
-
694
- // Set the counter as a thread-average quantity. It will
695
- // be presented divided by the number of threads.
696
- state.counters["FooAvg"] = Counter(numFoos, benchmark::Counter::kAvgThreads);
697
-
698
- // There's also a combined flag:
699
- state.counters["FooAvgRate"] = Counter(numFoos,benchmark::Counter::kAvgThreadsRate);
700
-
701
- // This says that we process with the rate of state.range(0) bytes every iteration:
702
- state.counters["BytesProcessed"] = Counter(state.range(0), benchmark::Counter::kIsIterationInvariantRate, benchmark::Counter::OneK::kIs1024);
703
- ```
704
-
705
- When you're compiling in C++11 mode or later you can use `insert()` with
706
- `std::initializer_list`:
707
-
708
- <!-- {% raw %} -->
709
- ```c++
710
- // With C++11, this can be done:
711
- state.counters.insert({{"Foo", numFoos}, {"Bar", numBars}, {"Baz", numBazs}});
712
- // ... instead of:
713
- state.counters["Foo"] = numFoos;
714
- state.counters["Bar"] = numBars;
715
- state.counters["Baz"] = numBazs;
716
- ```
717
- <!-- {% endraw %} -->
718
-
719
- ### Counter Reporting
720
-
721
- When using the console reporter, by default, user counters are printed at
722
- the end after the table, the same way as ``bytes_processed`` and
723
- ``items_processed``. This is best for cases in which there are few counters,
724
- or where there are only a couple of lines per benchmark. Here's an example of
725
- the default output:
726
-
727
- ```
728
- ------------------------------------------------------------------------------
729
- Benchmark Time CPU Iterations UserCounters...
730
- ------------------------------------------------------------------------------
731
- BM_UserCounter/threads:8 2248 ns 10277 ns 68808 Bar=16 Bat=40 Baz=24 Foo=8
732
- BM_UserCounter/threads:1 9797 ns 9788 ns 71523 Bar=2 Bat=5 Baz=3 Foo=1024m
733
- BM_UserCounter/threads:2 4924 ns 9842 ns 71036 Bar=4 Bat=10 Baz=6 Foo=2
734
- BM_UserCounter/threads:4 2589 ns 10284 ns 68012 Bar=8 Bat=20 Baz=12 Foo=4
735
- BM_UserCounter/threads:8 2212 ns 10287 ns 68040 Bar=16 Bat=40 Baz=24 Foo=8
736
- BM_UserCounter/threads:16 1782 ns 10278 ns 68144 Bar=32 Bat=80 Baz=48 Foo=16
737
- BM_UserCounter/threads:32 1291 ns 10296 ns 68256 Bar=64 Bat=160 Baz=96 Foo=32
738
- BM_UserCounter/threads:4 2615 ns 10307 ns 68040 Bar=8 Bat=20 Baz=12 Foo=4
739
- BM_Factorial 26 ns 26 ns 26608979 40320
740
- BM_Factorial/real_time 26 ns 26 ns 26587936 40320
741
- BM_CalculatePiRange/1 16 ns 16 ns 45704255 0
742
- BM_CalculatePiRange/8 73 ns 73 ns 9520927 3.28374
743
- BM_CalculatePiRange/64 609 ns 609 ns 1140647 3.15746
744
- BM_CalculatePiRange/512 4900 ns 4901 ns 142696 3.14355
745
- ```
746
-
747
- If this doesn't suit you, you can print each counter as a table column by
748
- passing the flag `--benchmark_counters_tabular=true` to the benchmark
749
- application. This is best for cases in which there are a lot of counters, or
750
- a lot of lines per individual benchmark. Note that this will trigger a
751
- reprinting of the table header any time the counter set changes between
752
- individual benchmarks. Here's an example of corresponding output when
753
- `--benchmark_counters_tabular=true` is passed:
754
-
755
- ```
756
- ---------------------------------------------------------------------------------------
757
- Benchmark Time CPU Iterations Bar Bat Baz Foo
758
- ---------------------------------------------------------------------------------------
759
- BM_UserCounter/threads:8 2198 ns 9953 ns 70688 16 40 24 8
760
- BM_UserCounter/threads:1 9504 ns 9504 ns 73787 2 5 3 1
761
- BM_UserCounter/threads:2 4775 ns 9550 ns 72606 4 10 6 2
762
- BM_UserCounter/threads:4 2508 ns 9951 ns 70332 8 20 12 4
763
- BM_UserCounter/threads:8 2055 ns 9933 ns 70344 16 40 24 8
764
- BM_UserCounter/threads:16 1610 ns 9946 ns 70720 32 80 48 16
765
- BM_UserCounter/threads:32 1192 ns 9948 ns 70496 64 160 96 32
766
- BM_UserCounter/threads:4 2506 ns 9949 ns 70332 8 20 12 4
767
- --------------------------------------------------------------
768
- Benchmark Time CPU Iterations
769
- --------------------------------------------------------------
770
- BM_Factorial 26 ns 26 ns 26392245 40320
771
- BM_Factorial/real_time 26 ns 26 ns 26494107 40320
772
- BM_CalculatePiRange/1 15 ns 15 ns 45571597 0
773
- BM_CalculatePiRange/8 74 ns 74 ns 9450212 3.28374
774
- BM_CalculatePiRange/64 595 ns 595 ns 1173901 3.15746
775
- BM_CalculatePiRange/512 4752 ns 4752 ns 147380 3.14355
776
- BM_CalculatePiRange/4k 37970 ns 37972 ns 18453 3.14184
777
- BM_CalculatePiRange/32k 303733 ns 303744 ns 2305 3.14162
778
- BM_CalculatePiRange/256k 2434095 ns 2434186 ns 288 3.1416
779
- BM_CalculatePiRange/1024k 9721140 ns 9721413 ns 71 3.14159
780
- BM_CalculatePi/threads:8 2255 ns 9943 ns 70936
781
- ```
782
-
783
- Note above the additional header printed when the benchmark changes from
784
- ``BM_UserCounter`` to ``BM_Factorial``. This is because ``BM_Factorial`` does
785
- not have the same counter set as ``BM_UserCounter``.
786
-
787
- <a name="multithreaded-benchmarks"/>
788
-
789
- ## Multithreaded Benchmarks
790
-
791
- In a multithreaded test (benchmark invoked by multiple threads simultaneously),
792
- it is guaranteed that none of the threads will start until all have reached
793
- the start of the benchmark loop, and all will have finished before any thread
794
- exits the benchmark loop. (This behavior is also provided by the `KeepRunning()`
795
- API) As such, any global setup or teardown can be wrapped in a check against the thread
796
- index:
797
-
798
- ```c++
799
- static void BM_MultiThreaded(benchmark::State& state) {
800
- if (state.thread_index() == 0) {
801
- // Setup code here.
802
- }
803
- for (auto _ : state) {
804
- // Run the test as normal.
805
- }
806
- if (state.thread_index() == 0) {
807
- // Teardown code here.
808
- }
809
- }
810
- BENCHMARK(BM_MultiThreaded)->Threads(2);
811
- ```
812
-
813
- To run the benchmark across a range of thread counts, instead of `Threads`, use
814
- `ThreadRange`. This takes two parameters (`min_threads` and `max_threads`) and
815
- runs the benchmark once for values in the inclusive range. For example:
816
-
817
- ```c++
818
- BENCHMARK(BM_MultiThreaded)->ThreadRange(1, 8);
819
- ```
820
-
821
- will run `BM_MultiThreaded` with thread counts 1, 2, 4, and 8.
822
-
823
- If the benchmarked code itself uses threads and you want to compare it to
824
- single-threaded code, you may want to use real-time ("wallclock") measurements
825
- for latency comparisons:
826
-
827
- ```c++
828
- BENCHMARK(BM_test)->Range(8, 8<<10)->UseRealTime();
829
- ```
830
-
831
- Without `UseRealTime`, CPU time is used by default.
832
-
833
- <a name="cpu-timers" />
834
-
835
- ## CPU Timers
836
-
837
- By default, the CPU timer only measures the time spent by the main thread.
838
- If the benchmark itself uses threads internally, this measurement may not
839
- be what you are looking for. Instead, there is a way to measure the total
840
- CPU usage of the process, by all the threads.
841
-
842
- ```c++
843
- void callee(int i);
844
-
845
- static void MyMain(int size) {
846
- #pragma omp parallel for
847
- for(int i = 0; i < size; i++)
848
- callee(i);
849
- }
850
-
851
- static void BM_OpenMP(benchmark::State& state) {
852
- for (auto _ : state)
853
- MyMain(state.range(0));
854
- }
855
-
856
- // Measure the time spent by the main thread, use it to decide for how long to
857
- // run the benchmark loop. Depending on the internal implementation detail may
858
- // measure to anywhere from near-zero (the overhead spent before/after work
859
- // handoff to worker thread[s]) to the whole single-thread time.
860
- BENCHMARK(BM_OpenMP)->Range(8, 8<<10);
861
-
862
- // Measure the user-visible time, the wall clock (literally, the time that
863
- // has passed on the clock on the wall), use it to decide for how long to
864
- // run the benchmark loop. This will always be meaningful, and will match the
865
- // time spent by the main thread in single-threaded case, in general decreasing
866
- // with the number of internal threads doing the work.
867
- BENCHMARK(BM_OpenMP)->Range(8, 8<<10)->UseRealTime();
868
-
869
- // Measure the total CPU consumption, use it to decide for how long to
870
- // run the benchmark loop. This will always measure to no less than the
871
- // time spent by the main thread in single-threaded case.
872
- BENCHMARK(BM_OpenMP)->Range(8, 8<<10)->MeasureProcessCPUTime();
873
-
874
- // A mixture of the last two. Measure the total CPU consumption, but use the
875
- // wall clock to decide for how long to run the benchmark loop.
876
- BENCHMARK(BM_OpenMP)->Range(8, 8<<10)->MeasureProcessCPUTime()->UseRealTime();
877
- ```
878
-
879
- ### Controlling Timers
880
-
881
- Normally, the entire duration of the work loop (`for (auto _ : state) {}`)
882
- is measured. But sometimes, it is necessary to do some work inside of
883
- that loop, every iteration, but without counting that time to the benchmark time.
884
- That is possible, although it is not recommended, since it has high overhead.
885
-
886
- <!-- {% raw %} -->
887
- ```c++
888
- static void BM_SetInsert_With_Timer_Control(benchmark::State& state) {
889
- std::set<int> data;
890
- for (auto _ : state) {
891
- state.PauseTiming(); // Stop timers. They will not count until they are resumed.
892
- data = ConstructRandomSet(state.range(0)); // Do something that should not be measured
893
- state.ResumeTiming(); // And resume timers. They are now counting again.
894
- // The rest will be measured.
895
- for (int j = 0; j < state.range(1); ++j)
896
- data.insert(RandomNumber());
897
- }
898
- }
899
- BENCHMARK(BM_SetInsert_With_Timer_Control)->Ranges({{1<<10, 8<<10}, {128, 512}});
900
- ```
901
- <!-- {% endraw %} -->
902
-
903
- <a name="manual-timing" />
904
-
905
- ## Manual Timing
906
-
907
- For benchmarking something for which neither CPU time nor real-time are
908
- correct or accurate enough, completely manual timing is supported using
909
- the `UseManualTime` function.
910
-
911
- When `UseManualTime` is used, the benchmarked code must call
912
- `SetIterationTime` once per iteration of the benchmark loop to
913
- report the manually measured time.
914
-
915
- An example use case for this is benchmarking GPU execution (e.g. OpenCL
916
- or CUDA kernels, OpenGL or Vulkan or Direct3D draw calls), which cannot
917
- be accurately measured using CPU time or real-time. Instead, they can be
918
- measured accurately using a dedicated API, and these measurement results
919
- can be reported back with `SetIterationTime`.
920
-
921
- ```c++
922
- static void BM_ManualTiming(benchmark::State& state) {
923
- int microseconds = state.range(0);
924
- std::chrono::duration<double, std::micro> sleep_duration {
925
- static_cast<double>(microseconds)
926
- };
927
-
928
- for (auto _ : state) {
929
- auto start = std::chrono::high_resolution_clock::now();
930
- // Simulate some useful workload with a sleep
931
- std::this_thread::sleep_for(sleep_duration);
932
- auto end = std::chrono::high_resolution_clock::now();
933
-
934
- auto elapsed_seconds =
935
- std::chrono::duration_cast<std::chrono::duration<double>>(
936
- end - start);
937
-
938
- state.SetIterationTime(elapsed_seconds.count());
939
- }
940
- }
941
- BENCHMARK(BM_ManualTiming)->Range(1, 1<<17)->UseManualTime();
942
- ```
943
-
944
- <a name="setting-the-time-unit" />
945
-
946
- ## Setting the Time Unit
947
-
948
- If a benchmark runs a few milliseconds it may be hard to visually compare the
949
- measured times, since the output data is given in nanoseconds per default. In
950
- order to manually set the time unit, you can specify it manually:
951
-
952
- ```c++
953
- BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
954
- ```
955
-
956
- Additionally the default time unit can be set globally with the
957
- `--benchmark_time_unit={ns|us|ms|s}` command line argument. The argument only
958
- affects benchmarks where the time unit is not set explicitly.
959
-
960
- <a name="preventing-optimization" />
961
-
962
- ## Preventing Optimization
963
-
964
- To prevent a value or expression from being optimized away by the compiler
965
- the `benchmark::DoNotOptimize(...)` and `benchmark::ClobberMemory()`
966
- functions can be used.
967
-
968
- ```c++
969
- static void BM_test(benchmark::State& state) {
970
- for (auto _ : state) {
971
- int x = 0;
972
- for (int i=0; i < 64; ++i) {
973
- benchmark::DoNotOptimize(x += i);
974
- }
975
- }
976
- }
977
- ```
978
-
979
- `DoNotOptimize(<expr>)` forces the *result* of `<expr>` to be stored in either
980
- memory or a register. For GNU based compilers it acts as read/write barrier
981
- for global memory. More specifically it forces the compiler to flush pending
982
- writes to memory and reload any other values as necessary.
983
-
984
- Note that `DoNotOptimize(<expr>)` does not prevent optimizations on `<expr>`
985
- in any way. `<expr>` may even be removed entirely when the result is already
986
- known. For example:
987
-
988
- ```c++
989
- /* Example 1: `<expr>` is removed entirely. */
990
- int foo(int x) { return x + 42; }
991
- while (...) DoNotOptimize(foo(0)); // Optimized to DoNotOptimize(42);
992
-
993
- /* Example 2: Result of '<expr>' is only reused */
994
- int bar(int) __attribute__((const));
995
- while (...) DoNotOptimize(bar(0)); // Optimized to:
996
- // int __result__ = bar(0);
997
- // while (...) DoNotOptimize(__result__);
998
- ```
999
-
1000
- The second tool for preventing optimizations is `ClobberMemory()`. In essence
1001
- `ClobberMemory()` forces the compiler to perform all pending writes to global
1002
- memory. Memory managed by block scope objects must be "escaped" using
1003
- `DoNotOptimize(...)` before it can be clobbered. In the below example
1004
- `ClobberMemory()` prevents the call to `v.push_back(42)` from being optimized
1005
- away.
1006
-
1007
- ```c++
1008
- static void BM_vector_push_back(benchmark::State& state) {
1009
- for (auto _ : state) {
1010
- std::vector<int> v;
1011
- v.reserve(1);
1012
- auto data = v.data(); // Allow v.data() to be clobbered. Pass as non-const
1013
- benchmark::DoNotOptimize(data); // lvalue to avoid undesired compiler optimizations
1014
- v.push_back(42);
1015
- benchmark::ClobberMemory(); // Force 42 to be written to memory.
1016
- }
1017
- }
1018
- ```
1019
-
1020
- Note that `ClobberMemory()` is only available for GNU or MSVC based compilers.
1021
-
1022
- <a name="reporting-statistics" />
1023
-
1024
- ## Statistics: Reporting the Mean, Median and Standard Deviation / Coefficient of variation of Repeated Benchmarks
1025
-
1026
- By default each benchmark is run once and that single result is reported.
1027
- However benchmarks are often noisy and a single result may not be representative
1028
- of the overall behavior. For this reason it's possible to repeatedly rerun the
1029
- benchmark.
1030
-
1031
- The number of runs of each benchmark is specified globally by the
1032
- `--benchmark_repetitions` flag or on a per benchmark basis by calling
1033
- `Repetitions` on the registered benchmark object. When a benchmark is run more
1034
- than once the mean, median, standard deviation and coefficient of variation
1035
- of the runs will be reported.
1036
-
1037
- Additionally the `--benchmark_report_aggregates_only={true|false}`,
1038
- `--benchmark_display_aggregates_only={true|false}` flags or
1039
- `ReportAggregatesOnly(bool)`, `DisplayAggregatesOnly(bool)` functions can be
1040
- used to change how repeated tests are reported. By default the result of each
1041
- repeated run is reported. When `report aggregates only` option is `true`,
1042
- only the aggregates (i.e. mean, median, standard deviation and coefficient
1043
- of variation, maybe complexity measurements if they were requested) of the runs
1044
- is reported, to both the reporters - standard output (console), and the file.
1045
- However when only the `display aggregates only` option is `true`,
1046
- only the aggregates are displayed in the standard output, while the file
1047
- output still contains everything.
1048
- Calling `ReportAggregatesOnly(bool)` / `DisplayAggregatesOnly(bool)` on a
1049
- registered benchmark object overrides the value of the appropriate flag for that
1050
- benchmark.
1051
-
1052
- <a name="custom-statistics" />
1053
-
1054
- ## Custom Statistics
1055
-
1056
- While having these aggregates is nice, this may not be enough for everyone.
1057
- For example you may want to know what the largest observation is, e.g. because
1058
- you have some real-time constraints. This is easy. The following code will
1059
- specify a custom statistic to be calculated, defined by a lambda function.
1060
-
1061
- ```c++
1062
- void BM_spin_empty(benchmark::State& state) {
1063
- for (auto _ : state) {
1064
- for (int x = 0; x < state.range(0); ++x) {
1065
- benchmark::DoNotOptimize(x);
1066
- }
1067
- }
1068
- }
1069
-
1070
- BENCHMARK(BM_spin_empty)
1071
- ->ComputeStatistics("max", [](const std::vector<double>& v) -> double {
1072
- return *(std::max_element(std::begin(v), std::end(v)));
1073
- })
1074
- ->Arg(512);
1075
- ```
1076
-
1077
- While usually the statistics produce values in time units,
1078
- you can also produce percentages:
1079
-
1080
- ```c++
1081
- void BM_spin_empty(benchmark::State& state) {
1082
- for (auto _ : state) {
1083
- for (int x = 0; x < state.range(0); ++x) {
1084
- benchmark::DoNotOptimize(x);
1085
- }
1086
- }
1087
- }
1088
-
1089
- BENCHMARK(BM_spin_empty)
1090
- ->ComputeStatistics("ratio", [](const std::vector<double>& v) -> double {
1091
- return std::begin(v) / std::end(v);
1092
- }, benchmark::StatisticUnit::kPercentage)
1093
- ->Arg(512);
1094
- ```
1095
-
1096
- <a name="memory-usage" />
1097
-
1098
- ## Memory Usage
1099
-
1100
- It's often useful to also track memory usage for benchmarks, alongside CPU
1101
- performance. For this reason, benchmark offers the `RegisterMemoryManager`
1102
- method that allows a custom `MemoryManager` to be injected.
1103
-
1104
- If set, the `MemoryManager::Start` and `MemoryManager::Stop` methods will be
1105
- called at the start and end of benchmark runs to allow user code to fill out
1106
- a report on the number of allocations, bytes used, etc.
1107
-
1108
- This data will then be reported alongside other performance data, currently
1109
- only when using JSON output.
1110
-
1111
- <a name="using-register-benchmark" />
1112
-
1113
- ## Using RegisterBenchmark(name, fn, args...)
1114
-
1115
- The `RegisterBenchmark(name, func, args...)` function provides an alternative
1116
- way to create and register benchmarks.
1117
- `RegisterBenchmark(name, func, args...)` creates, registers, and returns a
1118
- pointer to a new benchmark with the specified `name` that invokes
1119
- `func(st, args...)` where `st` is a `benchmark::State` object.
1120
-
1121
- Unlike the `BENCHMARK` registration macros, which can only be used at the global
1122
- scope, the `RegisterBenchmark` can be called anywhere. This allows for
1123
- benchmark tests to be registered programmatically.
1124
-
1125
- Additionally `RegisterBenchmark` allows any callable object to be registered
1126
- as a benchmark. Including capturing lambdas and function objects.
1127
-
1128
- For Example:
1129
- ```c++
1130
- auto BM_test = [](benchmark::State& st, auto Inputs) { /* ... */ };
1131
-
1132
- int main(int argc, char** argv) {
1133
- for (auto& test_input : { /* ... */ })
1134
- benchmark::RegisterBenchmark(test_input.name(), BM_test, test_input);
1135
- benchmark::Initialize(&argc, argv);
1136
- benchmark::RunSpecifiedBenchmarks();
1137
- benchmark::Shutdown();
1138
- }
1139
- ```
1140
-
1141
- <a name="exiting-with-an-error" />
1142
-
1143
- ## Exiting with an Error
1144
-
1145
- When errors caused by external influences, such as file I/O and network
1146
- communication, occur within a benchmark the
1147
- `State::SkipWithError(const std::string& msg)` function can be used to skip that run
1148
- of benchmark and report the error. Note that only future iterations of the
1149
- `KeepRunning()` are skipped. For the ranged-for version of the benchmark loop
1150
- Users must explicitly exit the loop, otherwise all iterations will be performed.
1151
- Users may explicitly return to exit the benchmark immediately.
1152
-
1153
- The `SkipWithError(...)` function may be used at any point within the benchmark,
1154
- including before and after the benchmark loop. Moreover, if `SkipWithError(...)`
1155
- has been used, it is not required to reach the benchmark loop and one may return
1156
- from the benchmark function early.
1157
-
1158
- For example:
1159
-
1160
- ```c++
1161
- static void BM_test(benchmark::State& state) {
1162
- auto resource = GetResource();
1163
- if (!resource.good()) {
1164
- state.SkipWithError("Resource is not good!");
1165
- // KeepRunning() loop will not be entered.
1166
- }
1167
- while (state.KeepRunning()) {
1168
- auto data = resource.read_data();
1169
- if (!resource.good()) {
1170
- state.SkipWithError("Failed to read data!");
1171
- break; // Needed to skip the rest of the iteration.
1172
- }
1173
- do_stuff(data);
1174
- }
1175
- }
1176
-
1177
- static void BM_test_ranged_fo(benchmark::State & state) {
1178
- auto resource = GetResource();
1179
- if (!resource.good()) {
1180
- state.SkipWithError("Resource is not good!");
1181
- return; // Early return is allowed when SkipWithError() has been used.
1182
- }
1183
- for (auto _ : state) {
1184
- auto data = resource.read_data();
1185
- if (!resource.good()) {
1186
- state.SkipWithError("Failed to read data!");
1187
- break; // REQUIRED to prevent all further iterations.
1188
- }
1189
- do_stuff(data);
1190
- }
1191
- }
1192
- ```
1193
- <a name="a-faster-keep-running-loop" />
1194
-
1195
- ## A Faster KeepRunning Loop
1196
-
1197
- In C++11 mode, a ranged-based for loop should be used in preference to
1198
- the `KeepRunning` loop for running the benchmarks. For example:
1199
-
1200
- ```c++
1201
- static void BM_Fast(benchmark::State &state) {
1202
- for (auto _ : state) {
1203
- FastOperation();
1204
- }
1205
- }
1206
- BENCHMARK(BM_Fast);
1207
- ```
1208
-
1209
- The reason the ranged-for loop is faster than using `KeepRunning`, is
1210
- because `KeepRunning` requires a memory load and store of the iteration count
1211
- ever iteration, whereas the ranged-for variant is able to keep the iteration count
1212
- in a register.
1213
-
1214
- For example, an empty inner loop of using the ranged-based for method looks like:
1215
-
1216
- ```asm
1217
- # Loop Init
1218
- mov rbx, qword ptr [r14 + 104]
1219
- call benchmark::State::StartKeepRunning()
1220
- test rbx, rbx
1221
- je .LoopEnd
1222
- .LoopHeader: # =>This Inner Loop Header: Depth=1
1223
- add rbx, -1
1224
- jne .LoopHeader
1225
- .LoopEnd:
1226
- ```
1227
-
1228
- Compared to an empty `KeepRunning` loop, which looks like:
1229
-
1230
- ```asm
1231
- .LoopHeader: # in Loop: Header=BB0_3 Depth=1
1232
- cmp byte ptr [rbx], 1
1233
- jne .LoopInit
1234
- .LoopBody: # =>This Inner Loop Header: Depth=1
1235
- mov rax, qword ptr [rbx + 8]
1236
- lea rcx, [rax + 1]
1237
- mov qword ptr [rbx + 8], rcx
1238
- cmp rax, qword ptr [rbx + 104]
1239
- jb .LoopHeader
1240
- jmp .LoopEnd
1241
- .LoopInit:
1242
- mov rdi, rbx
1243
- call benchmark::State::StartKeepRunning()
1244
- jmp .LoopBody
1245
- .LoopEnd:
1246
- ```
1247
-
1248
- Unless C++03 compatibility is required, the ranged-for variant of writing
1249
- the benchmark loop should be preferred.
1250
-
1251
- <a name="disabling-cpu-frequency-scaling" />
1252
-
1253
- ## Disabling CPU Frequency Scaling
1254
-
1255
- If you see this error:
1256
-
1257
- ```
1258
- ***WARNING*** CPU scaling is enabled, the benchmark real time measurements may
1259
- be noisy and will incur extra overhead.
1260
- ```
1261
-
1262
- you might want to disable the CPU frequency scaling while running the
1263
- benchmark, as well as consider other ways to stabilize the performance of
1264
- your system while benchmarking.
1265
-
1266
- See [Reducing Variance](reducing_variance.md) for more information.