Skip to content

Conversation

@frengor
Copy link
Owner

@frengor frengor commented May 25, 2023

  • Finalization is now optional behind the feature finalization (enabled by default).
    It's still necessary to implement the Finalize trait, even though finalization isn't enabled, in order to avoid issues when multiple crates enables different features (see here for an example of such an issue). If finalization is not enabled, simply the implementation of Finalize won't ever be called.
  • Renamed state::execution_count to state::executions_count.
  • The state::allocated_bytes and state::executions_count functions now return a Result.
  • Huge improvements and optimizations (from -6% to -18%, see benchmarks).

@frengor frengor added the run benchmarks Add this label to pull requests to run benchmarks label May 25, 2023
@github-actions
Copy link

Benchmark results:

benchmark_stress_test
Instructions: 90483574 (-6.529475%)
L1 Accesses: 128925655 (-6.349473%)
L2 Accesses: 1677867 (-9.740513%)
RAM Accesses: 93720 (-0.019202%)
Estimated Cycles: 140595190 (-6.421025%)

benchmark_count_binary_trees
Instructions: 97869425 (-17.86240%)
L1 Accesses: 143999575 (-18.37759%)
L2 Accesses: 246167 (-4.349532%)
RAM Accesses: 2120 (-0.609470%)
Estimated Cycles: 145304610 (-18.26860%)

benchmark_count_binary_trees_with_parent
Instructions: 174068004 (-10.37479%)
L1 Accesses: 252521084 (-10.57330%)
L2 Accesses: 1276582 (-0.666615%)
RAM Accesses: 3679 (-0.325115%)
Estimated Cycles: 259032759 (-10.34839%)

benchmark_large_linked_list
Instructions: 117723590 (-12.76636%)
L1 Accesses: 170741005 (-12.80217%)
L2 Accesses: 2331586 (-0.037257%)
RAM Accesses: 10079 (-0.158494%)
Estimated Cycles: 182751700 (-12.06436%)

Old results:

benchmark_stress_test
Instructions: 96804393
L1 Accesses: 137666770
L2 Accesses: 1858937
RAM Accesses: 93738
Estimated Cycles: 150242285

benchmark_count_binary_trees
Instructions: 119153011
L1 Accesses: 176421627
L2 Accesses: 257361
RAM Accesses: 2133
Estimated Cycles: 177783087

benchmark_count_binary_trees_with_parent
Instructions: 194217678
L1 Accesses: 282377718
L2 Accesses: 1285149
RAM Accesses: 3691
Estimated Cycles: 288932648

benchmark_large_linked_list
Instructions: 134952061
L1 Accesses: 195808772
L2 Accesses: 2332455
RAM Accesses: 10095
Estimated Cycles: 207824372


Results without finalization:

benchmark_stress_test
Instructions: 89923354 (-7.108189%)
L1 Accesses: 128080899 (-6.963076%)
L2 Accesses: 1666628 (-10.34646%)
RAM Accesses: 93715 (-0.027736%)
Estimated Cycles: 139694064 (-7.020940%)

benchmark_count_binary_trees
Instructions: 95275114 (-20.03969%)
L1 Accesses: 139847779 (-20.73087%)
L2 Accesses: 247095 (-4.042267%)
RAM Accesses: 2121 (-0.609185%)
Estimated Cycles: 141157489 (-20.60155%)

benchmark_count_binary_trees_with_parent
Instructions: 137631202 (-29.13559%)
L1 Accesses: 200636769 (-28.94736%)
L2 Accesses: 744478 (-42.07420%)
RAM Accesses: 3669 (-0.649878%)
Estimated Cycles: 204487574 (-29.22665%)

benchmark_large_linked_list
Instructions: 95478745 (-29.24988%)
L1 Accesses: 139165465 (-28.92787%)
L2 Accesses: 1461415 (-37.34458%)
RAM Accesses: 10075 (-0.208003%)
Estimated Cycles: 146825165 (-29.35135%)

Old results without finalization:

benchmark_stress_test
Instructions: 96804393
L1 Accesses: 137666739
L2 Accesses: 1858965
RAM Accesses: 93741
Estimated Cycles: 150242499

benchmark_count_binary_trees
Instructions: 119153011
L1 Accesses: 176421483
L2 Accesses: 257504
RAM Accesses: 2134
Estimated Cycles: 177783693

benchmark_count_binary_trees_with_parent
Instructions: 194217678
L1 Accesses: 282377638
L2 Accesses: 1285227
RAM Accesses: 3693
Estimated Cycles: 288933028

benchmark_large_linked_list
Instructions: 134952061
L1 Accesses: 195808762
L2 Accesses: 2332464
RAM Accesses: 10096
Estimated Cycles: 207824442

@github-actions github-actions bot removed the run benchmarks Add this label to pull requests to run benchmarks label May 25, 2023
@frengor
Copy link
Owner Author

frengor commented May 25, 2023

Results without finalization: #20 (comment)

The benchmark results with finalization disabled are so huge (from -7% to -29%) since the main branch doesn't allow to disable finalization. Thus, these benchmarks are rather representative of how much finalization impacts on performance (a lot!).

@frengor frengor merged commit 1fd29cb into main May 25, 2023
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.

1 participant