You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to support applications that try to avoid memory pressure, therefore we should not make unneeded allocations and buffer copies all over the place.
There are probably two classes of allocations happening right now:
const foo = bar || {}
buffer conversions, e.g. new Uint8Array([1, 2, 3])
Spawning new empty objects theoretically could be fine, as long as the particular vm has a generational gc, these objects should be very cheap to create and destroy (needs verifying). In any case, we can live without some js conveniences if it provides better experience overall.
Buffer conversions are more tricky. WebGL always requires data in a typed array format. Currently we try to not do needless conversions, but there are a few [] to typed array conversions which do copy data. We should probably remove buffer copying from those that are expected to be called often or in the rendering loop, e.g. VertexBuffer.store(). It also may make sense to create a separate higher-level API and make the current API strictly low-overhead.
The text was updated successfully, but these errors were encountered:
We would like to support applications that try to avoid memory pressure, therefore we should not make unneeded allocations and buffer copies all over the place.
There are probably two classes of allocations happening right now:
const foo = bar || {}
new Uint8Array([1, 2, 3])
Spawning new empty objects theoretically could be fine, as long as the particular vm has a generational gc, these objects should be very cheap to create and destroy (needs verifying). In any case, we can live without some js conveniences if it provides better experience overall.
Buffer conversions are more tricky. WebGL always requires data in a typed array format. Currently we try to not do needless conversions, but there are a few
[]
to typed array conversions which do copy data. We should probably remove buffer copying from those that are expected to be called often or in the rendering loop, e.g.VertexBuffer.store()
. It also may make sense to create a separate higher-level API and make the current API strictly low-overhead.The text was updated successfully, but these errors were encountered: