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: Alexander Shalamov via GitHub <sysbot+gh@w3.org>
Date: Wed, 07 Dec 2016 07:56:49 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-265380589-1481097408-sysbot+gh@w3.org>
@tobie Initially we've implemented API in most efficient way. The 
Sensor.reading was a 'current' reading, thus, no need to create new 
reading on every update. After discussion under 
(https://github.com/w3c/ambient-light/issues/15), you explained how 
you want API to behave and that SensorReading has to be recreated for 
every update.

So, I would propose to keep API as it is. If we want more FPS and less
 GC, we have to modify Sensor.reading description that will explain 
that Sensor.reading always points to current reading of the sensor.

'Sensor has reading' => interface Sensor { SensorReading reading; } 
(good design)
'Sensor is reading' => interface Sensor : SensorReading {} (bad 
design)

`which is stored in a shared memory buffer. It is not a sync poller.`

I know that Mikhail and I explained how we've implemented sensor 
reading update in Chromium, however, imo, we should avoid talking 
about UA specific implementation details.

-- 
GitHub Notification of comment by alexshalamov
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/153#issuecomment-265380589 using
 your GitHub account
Received on Wednesday, 7 December 2016 07:56:55 UTC

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