SpecFlow
SpecFlow copied to clipboard
improve performance / reduce allocations of FireEvents
Various improvements around FireEvents
BindingRegistry
- Change from List to Hashset to store Hookbindings for faster storage
- reduced closure allocations by removing LINQ
RuntimeBinding*
- Caching of lazy created objects like Parameter or Type
- AsArray extension method => Avoid calling ToArray if it is already an array to reduce allocation
- Throw on null in constructor and avoid check for null in hashcode (less branches equals faster hashcode)
TestExecutionEngine
- Removed unused fields
- GetExecuteArguments / ResolveArguments: remove LINQ and shortcut 0 length arguments
- FireEvents: Shortcut no / one hook invoke path. Reduce / delay allocations where possible
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue).
- [ ] New feature (non-breaking change which adds functionality).
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected).
- [x] Performance improvement
- [x] Refactoring (so no functional change)
- [ ] Other (docs, build config, etc)
Checklist:
- [ ] I've added tests for my code. (most of the time mandatory)
- [ ] I have added an entry to the changelog. (mandatory)
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
Proof [Before / After]
FireEvents

GetExecuteArguments

ResolveArguments

You are faster with sending new PRs then we with reviewing them. 😂
You are faster with sending new PRs then we with reviewing them. 😂
I had a few hours to spare the last few days. 😊 Just take your time 👍🏼
We will look at them next week.