Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add performance/profiling test #424

Merged
merged 7 commits into from
Dec 19, 2023
Merged

Conversation

martinsumner
Copy link
Owner

Add test to perf_SUITE to do performance tests and also profile different activities in leveled.

This can then be used to highlight functions with unexpectedly high execution times, and prove the impact of changes.

Switch between riak_ctperf and riak_fullperf to change from standard test (with profile option) to full-scale performance test

Add test to perf_SUITE to do performance tests and also profile different activities in leveled.

This can then be used to highlight functions with unexpectedly high execution times, and prove the impact of changes.

Switch between riak_ctperf and riak_fullperf to change from standard test (with profile option) to full-scale performance test
@martinsumner
Copy link
Owner Author

Profiles for each test in OTP 26 - develop-3.1 (functions > 1%)

GUESS:


lists:map_1/2                                         313370     2.33    32379  [      0.10]

lists:foldl_1/3                                       956590     4.81    66992  [      0.07]

leveled_sst:'-expand_list_by_pointer/5-fun-0-'/4      925020     6.13    85318  [      0.09]

erlang:binary_to_term/1                                 3881     8.55   119012  [     30.67]

erlang:'++'/2                                         974322    11.55   160724  [      0.16]

lists:member/2                                       4000180    15.00   208697  [      0.05]

leveled_sst:find_pos/4                               4029220    21.01   292347  [      0.07]

leveled_sst:member_check/2                           4000000    21.17   294601  [      0.07]

--------------------------------------------------  --------  -------  -------  [----------]

Total:                                              16894665  100.00%  1391759  [      0.08]
ESTIMATE:


sets:maybe_expand/1                                  1003520     1.27    49917  [      0.05]

sets:rehash/4                                         588000     1.45    56804  [      0.10]

leveled_sst:'-expand_list_by_pointer/5-fun-0-'/4      938610     2.09    81922  [      0.09]

erlang:setelement/3                                  2320640     2.55   100067  [      0.04]

sets:update_bucket/3                                 1003520     2.72   106414  [      0.11]

lists:map_1/2                                        1066010     2.85   111488  [      0.10]

lists:foldl_1/3                                      1973770     3.49   136771  [      0.07]

leveled_sst:member_check/2                           4000000     3.71   145201  [      0.04]

erlang:'++'/2                                        1010718     4.26   166721  [      0.16]

sets:get_bucket_s/2                                  5081920     4.39   171902  [      0.03]

sets:add_element/2                                   1003520     4.46   174531  [      0.17]

sets:get_bucket/2                                    5003520     4.62   181106  [      0.04]

lists:member/2                                       5003710     5.08   199087  [      0.04]

erlang:phash/2                                       5513120     6.10   238999  [      0.04]

leveled_sst:find_pos/4                               4028540     7.33   286994  [      0.07]

sets:get_slot/2                                      5003520     9.23   361502  [      0.07]

erlang:binary_to_term/1                                15254    11.44   448207  [     29.38]

sets:is_element/2                                    4000000    14.34   561434  [      0.14]

--------------------------------------------------  --------  -------  -------  [----------]

Total:                                              53968498  100.00%  3916525  [      0.07]
FULL_COUNT:

leveled_codec:strip_to_indexdetails/1                 4000000     1.06    194734  [      0.05]

leveled_codec:striphead_to_v1details/1                4000000     1.08    198993  [      0.05]

erlang:'++'/2                                         1099820     1.52    280134  [      0.25]

leveled_codec:is_active/3                             4000000     1.67    306889  [      0.08]

leveled_codec:key_dominates/2                         3995780     1.75    321227  [      0.08]

lists:keyreplace3/4                                   8411100     2.53    465228  [      0.06]

leveled_penciller:maybe_accumulate/5                  4000000     3.10    570415  [      0.14]

leveled_head:riak_metadata_to_binary/2                4000000     3.61    663550  [      0.17]

leveled_codec:return_proxy/4                          4000000     3.61    665175  [      0.17]

leveled_runner:'-accumulate_objects/4-fun-0-'/7       4000000     3.93    723163  [      0.18]

leveled_penciller:keyfolder/4                         4000010     4.00    735329  [      0.18]

erlang:term_to_binary/1                               4000000     7.91   1455707  [      0.36]

lists:keyfind/3                                      44003780    10.14   1866285  [      0.04]

leveled_penciller:find_nextkey/8                     44007960    20.19   3716511  [      0.08]

erlang:binary_to_term/1                                156130    23.35   4297826  [     27.53]

--------------------------------------------------  ---------  -------  --------  [----------]

Total:                                              177560449  100.00%  18404286  [      0.10]
HEAD:

rand:uniform/1                                      1027157     1.00    153707  [      0.15]

gen:reply/2                                          629262     1.05    161698  [      0.26]

leveled_pmem:find_pos/2                             4435367     1.29    199388  [      0.04]

array:get_1/3                                       5295285     1.31    201724  [      0.04]

leveled_ebloom:check_hash/2                          422162     1.57    241594  [      0.57]

prim_file:pread_nif/3                                199331     2.13    327933  [      1.65]

gen:do_call/4                                        629263     2.21    340134  [      0.54]

leveled_sst:member_check/2                         28824998     6.80   1048067  [      0.04]

leveled_sst:find_pos/4                             29050319    13.50   2079484  [      0.07]

erlang:binary_to_term/1                              199331    37.64   5799049  [     29.09]

------------------------------------------------  ---------  -------  --------  [----------]

Total:                                            132047844  100.00%  15406853  [      0.12]
GET:

gen:reply/2                                         503331     1.17    134400  [      0.27]

prim_file:pread_nif/3                                99926     1.60    184500  [      1.85]

prim_file:seek_nif/3                                420161     2.29    264529  [      0.63]

gen:do_call/4                                       503332     2.34    269886  [      0.54]

leveled_util:hash1/2                               5599940     2.83    326034  [      0.06]

leveled_sst:member_check/2                        13228384     4.17    480443  [      0.04]

prim_file:read_nif/2                                548022     6.80    783863  [      1.43]

zlib:inflate_nif/4                                  100000     8.04    927307  [      9.27]

leveled_sst:find_pos/4                            13331743     8.39    967184  [      0.07]

erlang:binary_to_term/1                             223780    26.36   3038293  [     13.58]

------------------------------------------------  --------  -------  --------  [----------]

Total:                                            82934421  100.00%  11526521  [      0.14]
LOAD:

leveled_sst:'-count_tombs/2-fun-0-'/2                    975407     1.08    72962  [      0.07]

leveled_sst:maybe_expand_pointer/1                      1951314     1.08    73105  [      0.04]

leveled_codec:maybe_reap_expiredkey/2                    975656     1.12    75370  [      0.08]

leveled_sst:accumulate_positions/2                       356787     1.17    78883  [      0.22]

leveled_codec:strip_to_statusonly/1                     1951063     1.17    79014  [      0.04]

lists:foldl_1/3                                         1099848     1.18    79880  [      0.07]

erlang:'++'/2                                             90028     1.19    80092  [      0.89]

leveled_codec:key_dominates/2                            948346     1.33    89563  [      0.09]

erlang:term_to_binary/1                                  207469     1.36    91968  [      0.44]

gen:do_call/4                                            120542     1.37    92773  [      0.77]

leveled_sst:form_slot/7                                  980114     1.58   106886  [      0.11]

leveled_sst:key_dominates_expanded/3                     975657     1.61   108687  [      0.11]

leveled_sst:key_dominates/3                              975657     1.66   112225  [      0.12]

lists:ukeymerge2_1/7                                    1071772     1.74   117463  [      0.11]

leveled_util:hash1/2                                    2240000     2.03   136997  [      0.06]

prim_file:pwrite_nif/3                                    40000     2.40   161771  [      4.04]

ets:insert/2                                              80000     3.77   254460  [      3.18]

erlang:binary_to_term/1                                   64748     6.93   467975  [      7.23]

zlib:deflate_nif/4                                        40000    15.03  1014101  [     25.35]

erlang:term_to_binary/2                                  102312    19.24  1298198  [     12.69]

-----------------------------------------------------  --------  -------  -------  [----------]

Total:                                                 33314828  100.00%  6748646  [      0.20]

Change the fullPerf test to run more tests, but with fewer keys.

Given that RS of 512 is being pushed in Riak, 2M objects is till a 300M+ object cluster. 10M >> 1B.  so these are still reasonable sizes to test.

A profilePerf test also added to generate all the profiles base don 2M objects.
Queries where previously all returning a large number of index entries - changes made to make number of entries per query more realistic.  Also an update process added to show difference between loading and rotating keys.
Test mini-queries - where generally a small number of entries are returned
@martinsumner martinsumner marked this pull request as ready for review December 19, 2023 11:52
@martinsumner martinsumner merged commit 49490c3 into develop-3.1 Dec 19, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants