Re: [sensors] Don't allocate response objects to avoid triggering GC

@alexshalamov @tobie - have answered pretty well.
GC stalls is very known problem working with real-time apps.
Current design on it's own wont lead to long GC, but it makes GC 
longer, which means there is less GC "buffer" for application logic. 
If application will go over the "buffer" or what GC can keep up with, 
it will get into Major GC long stalls and freeze every second or so. 
With only one solution - refresh the tab.
Remember that GC is shared between tabs of same JS thread (when 
opening pages in new tabs within same domain). This means multiple 
apps will contribute even more to GC.

Every little thing matters. And if API does not provides a way to 
avoid allocations then developers hitting the GC issues will struggle 
to deal with a problem.

As @tobie said:
> Designing CPU-hungry APIs designed for perf-sensitive applications 
with performance in mind isn't premature optimization, it's just Doing
 the Right Thing[TM]. ;)

-- 
GitHub Notification of comment by Maksims
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/153#issuecomment-266064993 using
 your GitHub account

Received on Friday, 9 December 2016 16:59:53 UTC