-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add temporary object pools #2
Comments
After doing some minor research I think the GC is good enough and creating temp weml types is fine. This topic is still open to debate though |
One point to consider is that the creation of a weml type really isn't that fast, mainly because of the manual |
I found that it's quite easy to create mulitple temporary vectors, even for seemingly simple calculations. Most of the vectors aren't even needed for long at all. At that rate, it may actually be benefitial to have object pools. They probably won't even need to hold many elements. As temporary vectors are only needed for one calculation most of the time the pool would just be passing one or two vectors from calculation to calculation. |
When implemented, the function to retrieve a type should have an optional bool ( |
I'm not too sure whether it's possible have WeakRefs in javascript and even if it were, local vars would keep the references till the end of the function. So, we need some sort of Maybe temporary types should be created with a special |
At the moment the proposed functions are the following:
I'm not a big fan of the term "return". Borrow/return is correct in the context of pools but especially the |
Add functions for retrieving temporary objects from a pool.
Most of the time Vector and Matrix instances are only needed for some calculations.
As weml types are Float32Arrays, creating loads of short-lived vectors and such may seriously impact performance
The text was updated successfully, but these errors were encountered: