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

[form-builder] Memoize hot methods #395

Merged
merged 1 commit into from
Nov 29, 2017
Merged

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Nov 29, 2017

The resolution of which input to use for which schema type is currently treated as a static mapping between schema type => input component. The resolution is done quite excessively, so this PR memoizes the schema type => input component map.

We may consider supporting dynamic input resolution later on, but I have not seen any compelling reasons to do so yet.

@bjoerge bjoerge requested a review from rexxars November 29, 2017 10:12
Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Out of interest, was the resolving taking up much CPU time?

@bjoerge bjoerge merged commit d04622f into next Nov 29, 2017
@bjoerge bjoerge deleted the memoize-type-to-input-map branch November 29, 2017 10:27
@bjoerge
Copy link
Member Author

bjoerge commented Nov 29, 2017

Out of interest, was the resolving taking up much CPU time?

Based on my rather unscientific tests: Not really a lot. I think it would make the biggest difference on large forms with many input fields, or if a custom input resolver does more heavy work.

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