-
Notifications
You must be signed in to change notification settings - Fork 550
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, thanks!
sessionTransactionProcMap = new ExpandableMap<CustomTransactionProcedureWithArity>(CustomCommandManager.MinMapSize, 0, byte.MaxValue); | ||
sessionCustomProcMap = new ExpandableMap<CustomProcedure>(CustomCommandManager.MinMapSize, 0, byte.MaxValue); | ||
|
||
sessionTransactionProcMap = new ExpandableMap<(CustomTransactionProcedure, int)>(MinMapSize, 0, byte.MaxValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not start the expandable map at 0 so that we dont pay the cost of memory in the common case that there are no custom commands? then then grow as 1,2,4, etc.
There was a problem hiding this 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.
private static readonly int MaxCustomRawStringCommands = 256; | ||
|
||
// Initial size of expandable maps | ||
private static readonly int MinMapSize = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not start the expandable map at 0 so that we dont pay the cost of memory in the common case that there are no custom commands? then then grow as 1,2,4, etc. (for CCM and CCMS)
This PR introduces some perf improvements to the execution path of custom commands:
Benchmarking results:
Current branch:
CustomOperations:
ModuleOperations:
main:
CustomOperations:
ModuleOperations: