[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] comparing typed arrays
On Wed, Jun 6, 2012 at 1:15 PM, Fabrice Robinet <email@example.com>
Indeed, specifying a range for the compare and underneath relying on memcmp is *exactly* what I believe is missing.
FYI: APIs working on typed arrays never take a range; views are used to work on ranges. This avoids having to add and specify range parameters for every API that works with typed arrays. It's also much clearer with APIs like comparison, where you have two ranges.
On Wed, Jun 6, 2012 at 2:13 PM, Kenneth Russell <firstname.lastname@example.org>
The intent in the typed array spec is minimality. Functionality isonly added when there are strong use cases.
Note that this doesn't necessarily have to be part of the typed arrays spec itself; secondary functionality can always be pushed to a separate spec, keeping the core spec minimal. (That spec can either supplement the ArrayBufferView interface, or create a new namespace.)
(I agree that use cases should always be there before adding any new APIs, of course. I'm just noting that typed arrays don't need *stronger* use cases than other specs.)
They're prototyping them to see whether they yield a speedup. If they
do, that's strong motivation for adding them.
(I suppose this will boil down to whether modern JIT can detect that a loop is a memcmp(), and convert it to an optimized version, though this does feel like a core operation that might make sense to provide anyway, for unity of code if not performance.)
BTW, discussion of typed arrays is welcome on this list, but you might
consider emailing email@example.com for a broader audience.
It's much the same audience, but firstname.lastname@example.org
might be a little better. (WebApps is a chartered W3C WG with a set list of deliverables, and Typed Arrays isn't one of them.)
FWIW, I seem to recall this coming up on whatwg in the past, but I don't recall where.