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 perf #28

Merged
merged 2 commits into from Dec 28, 2021
Merged

Improve perf #28

merged 2 commits into from Dec 28, 2021

Conversation

francisrstokes
Copy link
Owner

  • This PR only introduces changes to documentation.
    • Please include a summary of changes and an explanation
  • This PR adds new functionality
    • Is there a related issue?
      • Please note the related issue below, and how this PR relates to the issue if appropriate
    • Does the code style reasonably match the existing code?
    • Are the changes tested (using the existing format, as far as is possible?)
    • Are the changes documented in the readme with a suitable example?
    • Is the table of contents updated?
    • Is the index.d.ts file updated, using the same (or appropriately modified) description as in the readme?
  • This PR introduces some other kind of change

A pretty obvious improvement here - using an object to keep track of field names instead of an array. I noticed it was performing slowly on a pretty straightforward structure with thousands of fields, and realised it was spending a ton of time traversing arrays every time a field was added (and getting longer each time) 🤦‍♂️
No breaks in the user API, so this is just a nice "win".

@francisrstokes francisrstokes merged commit 2031d36 into master Dec 28, 2021
@francisrstokes francisrstokes deleted the improve-perf branch December 28, 2021 09:24
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.

None yet

1 participant