W3C home > Mailing lists > Public > public-device-apis-log@w3.org > December 2016

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

From: moka via GitHub <sysbot+gh@w3.org>
Date: Fri, 09 Dec 2016 16:59:47 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-266064993-1481302785-sysbot+gh@w3.org>
@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

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 12:18:52 UTC