-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Bucket: Arrays and buffers #2837
Conversation
2acb2e2
to
e88a9f6
Compare
* ?element2: ElementArrayType | ||
* }, | ||
* paint: { [layerName]: PaintVertexArrayType, ... } | ||
* vertexArray: VertexArrayType, |
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.
Why did you choose to call this vertexArray
instead of layoutArray
?
Conceptually the paintArrays
and layoutArray
are both vertex arrays. The distinguishing characteristic is that one contains data from paint properties and the other data from layout properties.
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.
Makes sense, I'll rename to layoutArray
.
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.
Or how about layoutVertexArray
, paintVertexArrays
, layoutVertexBuffer
, paintVertexBuffers
?
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.
That's good too 👍
This is ready to I have a bigger-picture refactoring of The hierarchy of objects in our data system roughly looks like this:
We could simplify by collapsing the hierarchy to:
There would be a 1:1 correspondence between
We could also factor all |
Holding on merge here until post 0.21 release to avoid regression risk. |
Ready to 🚢 ? |
The prior implementation was a no-op, because it skipped a level in the object hierarchy. Fixing this produced a meaningful benchmark improvement. Buffer benchmark before: 997ms; after: 895ms.
For a given bucket subclass, the VertexArrayType and optional ElementArrayType and ElementArrayType2 are constant for all instances. Initialize them once at startup.
* layout.vertex ⇢ vertexArray * layout.element ⇢ elementArray * layout.element2 ⇢ elementArray2 * paint ⇢ paintArrays
* layout.vertex ⇢ vertexBuffer * layout.element ⇢ elementBuffer * layout.element2 ⇢ elementBuffer2 * paint ⇢ paintBuffers
3cb4037
to
742b46d
Compare
Some refactoring of
Bucket
to reduce overhead, simplify object structure, improve naming conventions, and make the use of the terms "array" and "buffer" consistent (the latter always referring specifically to an instance ofBuffer
, not loosely as any kind of data collection).cc @lucaswoj