W3C home > Mailing lists > Public > public-device-apis-log@w3.org > March 2017

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

From: Alexander Shalamov via GitHub <sysbot+gh@w3.org>
Date: Mon, 20 Mar 2017 21:48:51 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-287908878-1490046529-sysbot+gh@w3.org>
> The thread on the chromium list talks about milliseconds.

I never said milliseconds in blink-dev, neither in this thread.

> This assumes that no application-level code interferes with this. Consider the following (inspired by a use case found in a related issue):

This is not a valid example, in the same way developers can populate buffer using `buffer.push({sensor.x; sensor.y; sensor.z});` and then try invalidating it during critical rendering path, e.g., re-layouting.

Based on profiling data for different code paths and initial feedback from developers who are implementing GC in V8 / blink, there is no technical proof that exposing objects instead of primitives would cause "stop-the-world" JS thread stalls because of GC.

Anyways, the change for the interfaces was already done, unfortunately, without any data or even JS example that represents the problem. I think we should avoid that in the future and do proper investigation before rushing to change everything.

GitHub Notification of comment by alexshalamov
Please view or discuss this issue at https://github.com/w3c/sensors/issues/153#issuecomment-287908878 using your GitHub account
Received on Monday, 20 March 2017 21:48:57 UTC

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