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

improve performance / allocations on CreateObject / ResolveArgument #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bollhals
Copy link

PR 4 extracted out of #40

Focused on the CreateObject / ResolveArgument
Main change:

  • avoid closure delegate allocation due to LINQ usage
  • simplify CreateObject
  • avoid allocation when no parameters required

Performance measurements:
Added new benchmarks that always create a new object

ResolveFromType:

Method AsSingleton Mean Error StdDev Min Max Median Rank Gen 0 Gen 1 Gen 2 Allocated
Current True 232.5 ns 1.24 ns 1.16 ns 230.8 ns 234.3 ns 232.5 ns 1 0.0730 - - 344 B
Master True 232.6 ns 0.64 ns 0.57 ns 231.6 ns 233.6 ns 232.6 ns 1 0.0730 - - 344 B
Current False 358.0 ns 3.38 ns 3.16 ns 353.9 ns 364.9 ns 357.0 ns 2 0.0696 - - 328 B
Master False 628.6 ns 6.21 ns 5.81 ns 618.5 ns 639.3 ns 628.2 ns 2 0.1459 - - 688 B

ResolveFromFactory

Method AsSingleton Mean Error StdDev Min Max Median Rank Gen 0 Gen 1 Gen 2 Allocated
Current True 250.7 ns 2.96 ns 2.76 ns 247.5 ns 255.5 ns 249.5 ns 1 0.0763 - - 360 B
Master True 250.4 ns 3.11 ns 2.91 ns 246.8 ns 254.7 ns 250.9 ns 1 0.0763 - - 360 B
Current False 915.3 ns 8.02 ns 7.50 ns 904.8 ns 929.6 ns 913.1 ns 2 0.1421 - - 672 B
Master False 1,088.2 ns 4.72 ns 4.18 ns 1,081.9 ns 1,093.5 ns 1,088.9 ns 2 0.1755 - - 832 B

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