Skip to content

Instantly share code, notes, and snippets.

@ThePhD
Created August 26, 2019 14:05
Show Gist options
  • Select an option

  • Save ThePhD/17515ebfa07e12d083c5097fa67bf896 to your computer and use it in GitHub Desktop.

Select an option

Save ThePhD/17515ebfa07e12d083c5097fa67bf896 to your computer and use it in GitHub Desktop.
Performance metrics of new bit iterators
L2 Unified 262K (x4)
L3 Unified 6291K (x1)
----------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------
noop 0.000 ns 0.000 ns 1000000000
is_sorted_by_hand 2807 ns 2762 ns 248889
is_sorted_base 50573 ns 50223 ns 11200
is_sorted_vector_bool 252820 ns 256696 ns 2800
is_sorted_bitset 202140 ns 199507 ns 3446
is_sorted_itsy_bitsy 839 ns 837 ns 746667
is_sorted_until_by_hand 2812 ns 2825 ns 248889
is_sorted_until_base 51320 ns 51562 ns 10000
is_sorted_until_vector_bool 255426 ns 256696 ns 2800
is_sorted_until_bitset 198101 ns 194972 ns 3446
is_sorted_until_itsy_bitsy 712 ns 715 ns 896000
find_by_hand 2694 ns 2727 ns 263529
find_base 23847 ns 24065 ns 29867
find_vector_bool 89738 ns 89979 ns 7467
find_bitset 96646 ns 96257 ns 7467
find_itsy_bitsy 2718 ns 2727 ns 263529
fill_by_hand 272 ns 273 ns 2635294
fill_base 2796 ns 2787 ns 263529
fill_vector_bool 271 ns 270 ns 2488889
fill_bitset 137941 ns 139509 ns 5600
fill_bitset_smart 257 ns 257 ns 2488889
fill_itsy_bitsy 263 ns 268 ns 2800000
fill_itsy_bitsy_smart 257 ns 257 ns 2800000
sized_fill_by_hand 257 ns 255 ns 2635294
sized_fill_base 2580 ns 2623 ns 280000
sized_fill_vector_bool 127094 ns 128348 ns 5600
sized_fill_bitset 125951 ns 125552 ns 4978
sized_fill_bitset_smart 251 ns 251 ns 2800000
sized_fill_itsy_bitsy 260 ns 262 ns 2800000
sized_fill_itsy_bitsy_smart 267 ns 268 ns 2800000
equal_by_hand 1030 ns 1046 ns 746667
equal_memcmp 0.328 ns 0.312 ns 1000000000
equal_base 0.318 ns 0.312 ns 1000000000
equal_vector_bool 242570 ns 239955 ns 2800
equal_vector_bool_operator 270586 ns 272770 ns 2635
equal_bitset 0.000 ns 0.000 ns 1000000000
equal_bitset_operator 0.000 ns 0.000 ns 1000000000
equal_itsy_bitsy 685 ns 684 ns 1120000
equal_itsy_bitsy_operator 0.321 ns 0.328 ns 1000000000
count_by_hand 5085 ns 5156 ns 100000
count_base 46455 ns 46038 ns 11200
count_vector_bool 98858 ns 97656 ns 6400
count_bitset 114628 ns 114746 ns 6400
count_bitset_smart 10441 ns 10498 ns 64000
count_itsy_bitsy 5020 ns 5082 ns 144516
count_itsy_bitsy_smart 5083 ns 5022 ns 112000
copy_by_hand 258 ns 255 ns 2635294
copy_base 3239 ns 3223 ns 213333
copy_vector_bool 195930 ns 196725 ns 3733
copy_bitset 147936 ns 150663 ns 4978
copy_bitset_operator 255 ns 257 ns 2800000
copy_itsy_bitsy 261 ns 261 ns 2635294
copy_itsy_bitsy_operator 264 ns 261 ns 2635294
sized_copy_by_hand 262 ns 261 ns 2635294
sized_copy_base 3237 ns 3223 ns 213333
sized_copy_vector_bool 212132 ns 209961 ns 3200
sized_copy_bitset 147954 ns 146484 ns 4480
sized_copy_itsy_bitsy 261 ns 261 ns 2635294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment