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
The spec has two methods, getHitTestResults() and getHitTestResultsForTransientInput(), which return FrozenArray<>s.
Methods that return frozen arrays is unusual. (These are the only two such methods on the web platform, actually.) In general we do not want to make it harder for web developers to reuse arrays that we give them.
In theory, this might be a performance optimization, if these methods are called frequently and there is often a cache hit. Is that the case? I kind of doubt it, because the spec doesn't do any work to actually freeze the arrays, and just says "mapping from XRHitTestSource to an array of XRHitTestResults" without mentioning the frozenness.
If this is not necessary for a performance optimization, then it would be best to move to sequence<>s. That would help fix whatwg/webidl#1399.
The text was updated successfully, but these errors were encountered:
After discussion on today's call it doesn't appear that implementations are currently attempting to re-use the returned array, so any potential optimizations this might have allowed aren't being actively pursued. As a result it seems fine to transition this to a regular sequence and remove the distinction of being the only API on the Web Platform that does this. 😄
The spec has two methods,
getHitTestResults()
andgetHitTestResultsForTransientInput()
, which returnFrozenArray<>
s.Methods that return frozen arrays is unusual. (These are the only two such methods on the web platform, actually.) In general we do not want to make it harder for web developers to reuse arrays that we give them.
In theory, this might be a performance optimization, if these methods are called frequently and there is often a cache hit. Is that the case? I kind of doubt it, because the spec doesn't do any work to actually freeze the arrays, and just says "mapping from XRHitTestSource to an array of XRHitTestResults" without mentioning the frozenness.
If this is not necessary for a performance optimization, then it would be best to move to
sequence<>
s. That would help fix whatwg/webidl#1399.The text was updated successfully, but these errors were encountered: