Skip to content

Instantly share code, notes, and snippets.

@bstaletic
Created October 2, 2018 17:39
Show Gist options
  • Save bstaletic/3f57f8c6357d7ef937e48564939b63b3 to your computer and use it in GitHub Desktop.
Save bstaletic/3f57f8c6357d7ef937e48564939b63b3 to your computer and use it in GitHub Desktop.
string_view vs const std::string&
---------------------------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------------------------------------------------------------
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/0 823 ns 823 ns 793146
IdentifierCompleterFixture/CandidatesWithCommonPrefix/16/0 4815 ns 4815 ns 135540
IdentifierCompleterFixture/CandidatesWithCommonPrefix/256/0 104214 ns 104213 ns 6618
IdentifierCompleterFixture/CandidatesWithCommonPrefix/4096/0 2004064 ns 2004023 ns 295
IdentifierCompleterFixture/CandidatesWithCommonPrefix/65536/0 45311469 ns 45310567 ns 14
IdentifierCompleterFixture_BigO 43.21 NlgN 43.21 NlgN
IdentifierCompleterFixture_RMS 1 % 1 %
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/10 790 ns 790 ns 888063
IdentifierCompleterFixture/CandidatesWithCommonPrefix/16/10 4649 ns 4649 ns 148061
IdentifierCompleterFixture/CandidatesWithCommonPrefix/256/10 64724 ns 64723 ns 10820
IdentifierCompleterFixture/CandidatesWithCommonPrefix/4096/10 934773 ns 934767 ns 751
IdentifierCompleterFixture/CandidatesWithCommonPrefix/65536/10 20795751 ns 20795286 ns 33
IdentifierCompleterFixture_BigO 19.83 NlgN 19.83 NlgN
IdentifierCompleterFixture_RMS 0 % 0 %
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/1/0 4854 ns 4876 ns 142716
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/16/0 47688 ns 47755 ns 14733
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/256/0 758095 ns 758389 ns 921
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/4096/0 11487752 ns 11488168 ns 60
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/65536/0 199875138 ns 199871607 ns 4
PythonSupportFixture_BigO 3048.90 N 3048.84 N
PythonSupportFixture_RMS 1 % 1 %
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/1/50 4895 ns 4923 ns 142198
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/16/50 49002 ns 49070 ns 13993
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/256/50 712231 ns 712538 ns 943
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/4096/50 10823761 ns 10824204 ns 63
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/65536/50 176805606 ns 176805902 ns 4
PythonSupportFixture_BigO 2697.63 N 2697.63 N
PythonSupportFixture_RMS 0 % 0 %
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/1/0 1224 ns 1224 ns 568240
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/16/0 8060 ns 8060 ns 85602
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/256/0 134462 ns 134461 ns 5148
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/4096/0 2202073 ns 2202059 ns 321
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/65536/0 54245673 ns 54244368 ns 13
PythonSupportFixture_BigO 51.72 NlgN 51.72 NlgN
PythonSupportFixture_RMS 1 % 1 %
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/1/50 1236 ns 1236 ns 569590
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/16/50 8012 ns 8012 ns 86669
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/256/50 97352 ns 97352 ns 7154
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/4096/50 1492952 ns 1492911 ns 463
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/65536/50 32380273 ns 32379545 ns 22
PythonSupportFixture_BigO 30.88 NlgN 30.88 NlgN
PythonSupportFixture_RMS 0 % 0 %
---------------------------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------------------------------------------------------------
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/0 819 ns 819 ns 840980
IdentifierCompleterFixture/CandidatesWithCommonPrefix/16/0 6124 ns 6124 ns 116273
IdentifierCompleterFixture/CandidatesWithCommonPrefix/256/0 133123 ns 133117 ns 5198
IdentifierCompleterFixture/CandidatesWithCommonPrefix/4096/0 3386625 ns 3386565 ns 212
IdentifierCompleterFixture/CandidatesWithCommonPrefix/65536/0 82033493 ns 82024736 ns 10
IdentifierCompleterFixture_BigO 78.21 NlgN 78.20 NlgN
IdentifierCompleterFixture_RMS 1 % 1 %
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/10 796 ns 796 ns 868896
IdentifierCompleterFixture/CandidatesWithCommonPrefix/16/10 5926 ns 5926 ns 119802
IdentifierCompleterFixture/CandidatesWithCommonPrefix/256/10 68738 ns 68735 ns 10142
IdentifierCompleterFixture/CandidatesWithCommonPrefix/4096/10 1009029 ns 1008958 ns 687
IdentifierCompleterFixture/CandidatesWithCommonPrefix/65536/10 20848883 ns 20846637 ns 33
IdentifierCompleterFixture_BigO 19.88 NlgN 19.88 NlgN
IdentifierCompleterFixture_RMS 0 % 0 %
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/1/0 5042 ns 5084 ns 138087
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/16/0 45001 ns 45085 ns 15662
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/256/0 682269 ns 682454 ns 1004
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/4096/0 11187767 ns 11187169 ns 61
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/65536/0 205417696 ns 205394159 ns 3
PythonSupportFixture_BigO 195.97 NlgN 195.95 NlgN
PythonSupportFixture_RMS 2 % 2 %
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/1/50 5117 ns 5158 ns 134921
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/16/50 44291 ns 44385 ns 15772
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/256/50 613556 ns 613751 ns 1127
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/4096/50 9595296 ns 9594877 ns 70
PythonSupportFixture/FilterAndSortUnstoredCandidatesWithCommonPrefix/65536/50 167068401 ns 167066297 ns 4
PythonSupportFixture_BigO 2548.46 N 2548.42 N
PythonSupportFixture_RMS 1 % 1 %
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/1/0 1345 ns 1345 ns 519703
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/16/0 8616 ns 8616 ns 78408
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/256/0 157720 ns 157718 ns 4461
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/4096/0 2879320 ns 2879276 ns 241
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/65536/0 68712233 ns 68710148 ns 10
PythonSupportFixture_BigO 65.51 NlgN 65.51 NlgN
PythonSupportFixture_RMS 1 % 1 %
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/1/50 1336 ns 1336 ns 522113
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/16/50 8851 ns 8850 ns 78160
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/256/50 100794 ns 100793 ns 6777
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/4096/50 1509673 ns 1509665 ns 451
PythonSupportFixture/FilterAndSortStoredCandidatesWithCommonPrefix/65536/50 31970470 ns 31970253 ns 20
PythonSupportFixture_BigO 30.49 NlgN 30.49 NlgN
PythonSupportFixture_RMS 0 % 0 %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment