Re: Firefox and User Timing API in workers

+kenji, ksakamoto

Hi Andrea. Thanks for the heads up!

FWIW, I believe the spec omission is an oversight on this end. We've
recently updated Resource Timing [1] to be exposed to Workers and we just
need to do the same for User Timing. Also, similar bug on Chrome side:


On Thu, May 21, 2015 at 12:09 PM, Andrea Marchesini <
> wrote:

> Hi all,
> I have recently worked on the porting of user timing API in workers in
> Firefox. The reason why this is needed is because it will allow the user to
> do some useful benchmark when content is loaded and managed from/by
> ServiceWorkers. But it's also useful for performance analysis of worker
> codes.
> This code is not landed yet because I thought that was important to inform
> you first. As the user timing API, from the spec point of view, should not
> exposed to workers.
> As probably you know, Firefox already has in workers
> (Workers, Shared Workers, Service Workers). And now we expose all the User
> Timing interfaces:
> PerformanceMark, PerformanceMeasure, PerformanceEntry and the partial
> Performance interface as described by the point 4.2:

> Our implementation is here:
> Important points in our code are:
> 1. all the PerformanceEntry buffers/queue are per thread: marks are not
> shared between worker and main-thread or workers and other workers. They
> are owned by the performance object exposed in the Worker global scope.
> This also means that performance.clearMarks() removes the existing marks
> only in the current performance object.
> 2. PerformanceTiming is not exposed to workers. The only attribute that
> can be used as marker name is 'navigationStart'.

Not sure I follow this. Why are the marker names restricted? Is this
related to: -- ?

> 3. navigationStart is taken from the window PerformanceTiming object when
> the worker is created.
> For window-less workers (SharedWorkers, ServiceWorkers) navigationStart is
> the creation time of the worker itself.

Note that we've recently added workerStart to RT:


Received on Friday, 22 May 2015 20:55:45 UTC