Skip to content
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

Performance improvement: Don't call .subarray on final array #4

Open
mikolalysenko opened this issue Apr 23, 2014 · 0 comments
Open

Comments

@mikolalysenko
Copy link
Member

It would probably be a bit faster to not return a subarray slice of a typedarray from the voxel mesher and instead return the entire unsliced typedarray + a size parameter for the number of vertices. That way the typedarray that it creates would not be truncated and could possibly be returned to the memory pool when it is done.

In a web worker type environment, the way this could work is the worker would generate typedarrays/chunks, pass them directly to the main thread which uploads them to WebGL, and then the main thread would pass them back to the worker which would put them back on the heap. (By calling typedarray-pool.free)

https://github.com/mikolalysenko/typedarray-pool#poolfreearray

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant