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

@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