Work in progress to improve performance and garbage collection#792
Draft
jacob-kofoed wants to merge 3 commits into
Draft
Work in progress to improve performance and garbage collection#792jacob-kofoed wants to merge 3 commits into
jacob-kofoed wants to merge 3 commits into
Conversation
jacob-kofoed
commented
Feb 25, 2026
| logErrors: boolean | ||
| } | ||
|
|
||
| const FORMULA_TYPES = [ |
Contributor
Author
There was a problem hiding this comment.
Not guaranteed that browsers would not reallocate this array every time.
jacob-kofoed
commented
Feb 25, 2026
| if (first) { | ||
| return { ...input, Args: { key: first[0], value: first[1] } } | ||
| for (const key in items) { | ||
| if (Object.prototype.hasOwnProperty.call(items, key)) { |
Contributor
Author
There was a problem hiding this comment.
This check is probably not needed, but would be a breaking change for someone looping over prototyped objects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft PR. Requires testing to see actual real-life benefits, as code is more obfuscated.
Classic example of fast code being a lot less readable than clean one. General idea of this PR is to remove object and array allocations (Object.entries etc.). Benefits are pretty minimal per execution, so this kind of optimisation only really make sense in the core for now, which can run thousand of times for even small changes in data.
Quick metrics:
Probably more to come for as substantial time is still spent on GC, even with these changes.