[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] WebGL bufferSubData lacks "size" parameter



That's true, but your basic point is still valid: creating lots of small objects in JS is fundamental. If there are GC issues, fiddling with APIs to try to avoid creating objects is absolutely the wrong fix, and can only result in nonidiomatic, unnatural APIs. GC issues should be dealt with at the appropriate layer, not hacked around by each API.

Note that you don't have to create a sub-view each time; you can create it once and cache it, if you really want to.

On Jan 11, 2012 10:56 PM, "Gregg Tavares (wrk)" <gman@google.com> wrote:
Okay, egg on my face yet again.

Someone once told everything in _javascript_ is an object
Someone else once told me adding 2 numbers generates a new object.

I believed them until today.

The truth is more complicated

http://www.2ality.com/2011/03/_javascript_-values-not-everything-is.html