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

Build with constructor reference #10

Merged
merged 1 commit into from
Mar 23, 2016
Merged

Build with constructor reference #10

merged 1 commit into from
Mar 23, 2016

Conversation

vjkoskela
Copy link
Member

Improve builder instantiation by using a constructor reference instead of class and constructor look-up. Caching the constructor per class did not provide significant wins. However, the function reference appears to provide non-trivial wins.

Over 1,000,000 executions the two strategies perform as follows:

Reflection took: 0.061923918 sec
Functional took: 0.008091248 sec

That's almost a 10x performance improvement on construction. There are of course larger issues (e.g. #1 and #2) but this was a low-cost fix with solid returns.

@BrandonArp BrandonArp merged commit a57ff80 into master Mar 23, 2016
@BrandonArp BrandonArp deleted the constructor-builder branch March 23, 2016 18:41
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