Discussion: WebJobs SDK Extensions Throughput Performance Improvements & Opportunities #755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a draft PR for discussion and not meant to be merged, think "issue with some code". I figured this was the easiest way to talk about areas we can improve throughput performance in the least spammy way possible.
Proposals Summary
These diffs are not proposed PRs. They are pain points or opportunities identified in profiling and experimentation where I think we can improve performance. It's likely some are viable and some are not due to constraints I'm unaware of (so let's talk!). The hope is that some of these findings help in making us faster and spur new discussions on the remaining.
Goals
A lot of these I file under "papercuts". Except 1 very recent regression in the
4.x
branch (which @fabiocav and @brettsam are looking at already), there is no large single item affecting performance that I can see. However, there are many small items we can potentially improve that add up. I'm numbering these in lists below so that they're easy to refer to and talk about in discussions in a quick way.It's worth breaking these down and testing each we consider viable, though each may be a small gain in itself. In aggregate I'm seeing 24-38% gains (depending on scenario) with our typical 2 and 4 core VMs for a hello world scenario. We need to test this in App Services yet (private stamp issues...) and the gains will be proportionately smaller when the function itself is more expensive. See #7908 for performance data.
These proposals are split across 3 repos and need discussion PRs for each (I'll update this as I create PRs)
Optimizations: WebJobs SDK Extensions
ToInvokeString()
generates the same string every time, with a (assumption) minimal cardinality. We can ConcurrentDictionary away this allocation to prevent repetition and reduce GC per request.Diff Notes
<GenerateDocumentation>true</GenerateDocumentation>
resolved it correctly - I can PR this as a non-performance fix.