-
Notifications
You must be signed in to change notification settings - Fork 86
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
Replace JSON case cache serialization with binary files #3094
Conversation
9cc0289
to
d238b9f
Compare
Previews, as seen when this build job started (d238b9f): |
d238b9f
to
0936974
Compare
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.
Did a first-pass on this, the broad overview of this looks reasonable to me, I will take another look in the morning.
This is a pretty complex TS change, so adding Kai to the review for more eyes/expertise.
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.
honestly much simpler than I expected! which is great
one comment about potentially using DataView so that handling the offsets is likely simpler
also, I see "@ p" in various places - is this supposed to be "@ param" ?
(I've inserted a space as to not tag random folks)
this.i32 = new Int32Array(this.u8.buffer); | ||
this.f16 = new Float16Array(this.u8.buffer); | ||
this.f32 = new Float32Array(this.u8.buffer); | ||
this.f64 = new Float64Array(this.u8.buffer); |
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.
would it be simpler with DataView?
blog says it should be just as fast as native typed arrays if you use little-endian
https://v8.dev/blog/dataview
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.
Maybe. I briefly looked at DataView
but reached for what I knew worked. I don't mind trying DataView
as a followup change, to see if there are any perf wins.
0936974
to
0651deb
Compare
|
Previews, as seen when this build job started (0651deb): |
I didn't know this, but fine with me |
I'll defer to Austin's review unless someone specifically wants mine. |
Unsure if |
Once gpuweb/cts#3094 lands and rolls, the case cache will move from JSON to binary. The fetch() needs to handle this change of encoding. Change-Id: Iecc8ead12bdff2d64bc3bf129022bf4686ce70d9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/158061 Commit-Queue: Ben Clayton <[email protected]> Auto-Submit: Ben Clayton <[email protected]> Reviewed-by: Austin Eng <[email protected]> Commit-Queue: Austin Eng <[email protected]> Kokoro: Kokoro <[email protected]> Kokoro: Ben Clayton <[email protected]>
The TSDoc doesn't list |
0651deb
to
8614162
Compare
This removes a the need to create bunch of temporary JSON objects, reducing the amount of garbage collection we need to do. This change also changes the DataCache to be unbounded to a 4-element LRU cache, capping the amount of memory used.
8614162
to
34dc503
Compare
Previews, as seen when this build job started (34dc503): |
With gpuweb/cts#3094 landed, the case cache now produces binary files, not JSON files. Change-Id: I7d297c14d28a5d8247a8e7cf72483188a7e5bd8e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/158181 Commit-Queue: Austin Eng <[email protected]> Kokoro: Kokoro <[email protected]> Reviewed-by: Austin Eng <[email protected]> Auto-Submit: Ben Clayton <[email protected]>
This PR removes a the need to create bunch of temporary JSON objects, reducing the amount of garbage collection we need to do.
This change also changes the DataCache to be unbounded to a 4-element LRU cache, capping the amount of memory used.
Issue: #3039
Requirements for PR author:
.unimplemented()
./** documented */
and new helper files are found inhelper_index.txt
.Requirements for reviewer sign-off:
When landing this PR, be sure to make any necessary issue status updates.