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

perf: minor tweaks to core functions #1184

Merged
merged 7 commits into from
May 27, 2020
Merged

perf: minor tweaks to core functions #1184

merged 7 commits into from
May 27, 2020

Conversation

P0lip
Copy link
Contributor

@P0lip P0lip commented May 26, 2020

A subset of changes from #1136.
I'm planning to merge it post 5.4.

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

Additional context

A few minor tweaks, mostly to avoid allocation of arrays that are never needed for most of the time.
At the moment, plenty of core functions allocate an array even if no actual validation is to take place due to invalid data, etc.
This causes unnecessary GC churn in case of larger specs, because these functions are called very often - thousands of times in some circumstances.

One unrelated change - moved the validation of reusableObjectsLocation to schema.

@P0lip P0lip added the chore label May 26, 2020
@P0lip P0lip requested a review from nulltoken May 26, 2020 00:24
@P0lip P0lip self-assigned this May 26, 2020
@P0lip P0lip mentioned this pull request May 26, 2020
4 tasks
@nulltoken
Copy link
Contributor

LGTM! Could you also update the doco describing how to build custom functions to match this recommended code writing pattern?

nulltoken
nulltoken previously approved these changes May 26, 2020
@P0lip
Copy link
Contributor Author

P0lip commented May 26, 2020

@nulltoken added!

@P0lip P0lip requested a review from nulltoken May 26, 2020 12:41
nulltoken
nulltoken previously approved these changes May 27, 2020
@P0lip P0lip merged commit 0255f98 into develop May 27, 2020
@P0lip P0lip deleted the perf/core-functions branch May 27, 2020 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants