-
-
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 write instruction compilation #813
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. |
return path.length === 0 ? 'value' : `value.${path.join('.')}`; | ||
} | ||
|
||
const compiledWriters = new Map< |
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.
const compiledWriters = new Map< | |
const compiledWriters = new WeakMap< |
Permanently storing a buffer is likely a good approach as a default, but some apps might want to keep the buffer gpu-only to save on memory when the buffer doesn't change often. This becomes especially interesting when you start allowing partial writes, where the update buffer could be tiny compared to the full thing. But this can be implemented later as an extension of the same API. |
At the moment it only creates the buffer when you fist write to a schema. Partial writes don't trigger this behaviour so as long as you only partial write the main buffer will never be created. Of course that is subject to change if we want to incorporate compiling to partial write which will be more difficult. There is also a major optimisation to be made for the partial write algorithm since it currently always creates an ArrayBuffer the size of the schema but it should be feasible to only make it as big as necessary without much overhead. |
extends #808
closes #801