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

Perf Improvements to Custom Commands' Execution Path #940

Merged
merged 12 commits into from
Jan 28, 2025

Conversation

TalZaccai
Copy link
Contributor

@TalZaccai TalZaccai commented Jan 21, 2025

This PR introduces some perf improvements to the execution path of custom commands:

  • Unlatched access to custom commands' data structures in CustomCommandManager
  • Eliminating expensive string-based RespCommandInfo access for arity check by adding arity property to commands classes.

Benchmarking results:

Current branch:

CustomOperations:

Method Params Mean Error StdDev Median Allocated
CustomRawStringCommand None 43.23 us 0.949 us 2.783 us 42.49 us -
CustomObjectCommand None 146.70 us 2.880 us 4.568 us 145.93 us 18400 B
CustomTransaction None 92.77 us 1.545 us 2.706 us 92.05 us -
CustomProcedure None 72.35 us 0.595 us 0.557 us 72.15 us -

ModuleOperations:

Method Params Mean Error StdDev Median Gen0 Allocated
ModuleNoOpRawStringReadCommand None 39.59 us 0.784 us 1.863 us 38.96 us - -
ModuleNoOpRawStringRmwCommand None 48.62 us 0.963 us 2.604 us 47.87 us - -
ModuleNoOpObjRmwCommand None 64.37 us 1.277 us 2.491 us 64.53 us - 3200 B
ModuleNoOpObjReadCommand None 55.30 us 1.096 us 2.770 us 54.64 us - 3200 B
ModuleNoOpProc None 31.71 us 0.368 us 0.344 us 31.70 us - -
ModuleNoOpTxn None 30.33 us 0.601 us 1.186 us 30.14 us - -
ModuleJsonGetCommand None 125.22 us 2.487 us 5.354 us 124.29 us - 72800 B
ModuleJsonSetCommand None 216.43 us 2.273 us 2.015 us 216.43 us 0.4883 223200 B

main:

CustomOperations:

Method Params Mean Error StdDev Median Allocated
CustomRawStringCommand None 46.06 us 0.692 us 0.824 us 45.70 us -
CustomObjectCommand None 175.01 us 4.435 us 12.216 us 170.85 us 24000 B
CustomTransaction None 98.49 us 1.959 us 2.932 us 98.16 us -
CustomProcedure None 83.08 us 1.629 us 2.938 us 82.53 us -

ModuleOperations:

Method Params Mean Error StdDev Gen0 Allocated
ModuleNoOpRawStringReadCommand None 46.36 us 0.927 us 1.624 us - -
ModuleNoOpRawStringRmwCommand None 54.67 us 1.083 us 0.960 us - -
ModuleNoOpObjRmwCommand None 84.71 us 1.627 us 4.400 us - 8800 B
ModuleNoOpObjReadCommand None 69.37 us 1.373 us 1.527 us - 5600 B
ModuleNoOpProc None 39.89 us 0.794 us 1.259 us - -
ModuleNoOpTxn None 34.98 us 0.649 us 1.136 us - -
ModuleJsonGetCommand None 131.93 us 2.474 us 4.884 us - 72800 B
ModuleJsonSetCommand None 235.78 us 3.061 us 2.863 us 0.4883 228801 B

Copy link
Contributor

@badrishc badrishc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good, thanks!

@TalZaccai TalZaccai requested a review from badrishc January 25, 2025 01:49
Copy link
Contributor

@badrishc badrishc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix memory use by default.

@TalZaccai TalZaccai merged commit 3e5ecde into main Jan 28, 2025
18 checks passed
@TalZaccai TalZaccai deleted the talzacc/perf_mem_impr2 branch January 28, 2025 00:03
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.

2 participants