-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implement more performant partial IO #808
base: main
Are you sure you want to change the base?
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
const sortedProps = Object.entries(propOffsets).sort( | ||
(a, b) => a[1].offset - b[1].offset, // Sort by offset | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The propOffsets
should always be in the correct order already. But I don't think it's guaranteed. It doesn't cost much to sort it here.
throw new Error('Partial value for array must be an array'); | ||
} | ||
|
||
partialValue.sort((a, b) => a.idx - b.idx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary since we don't want to sort all the write instructions later. If we don't sort here the instructions will still be valid but will not get properly merged. Sorting here is way less of an overhead than sorting all the instructions.
Performance vs #803: