Successive calls to window.performance.measure do not record measurements

UNCONFIRMED
Unassigned

Status

()

Core
DOM
UNCONFIRMED
2 years ago
2 years ago

People

(Reporter: Ben Campbell, Unassigned)

Tracking

42 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2600.0 Safari/537.36

Steps to reproduce:

I repeatedly tried to record various measurements through the window.performance.measure(name, start, end); function.

for(var i = 0; i < 150; i++) {
    window.performance.mark('start'+i);
    window.performance.mark('end'+i);
    window.performance.measure('test-'+i, 'start'+i, 'end'+i);
}

window.performance.getEntriesByType('measure');


Actual results:

The call to getEntriesByType returned 49 measurements out of the 150 calls to measure. The 49 measurements are the first 49 recorded.


Expected results:

All 150 measurements should have been recorded.

Updated

2 years ago
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Seems to be an issue related to the Performance object, which belongs to DOM, not JS.
Component: JavaScript Engine → DOM

Updated

2 years ago
Flags: needinfo?(kyle)

Comment 2

2 years ago
Don't you need to call setResourceTimingBufferSize?

Comment 3

2 years ago
Hmm, but it should still be 150 by default, if I read the code right.
Kyle or hiro, you should knot this stuff.
Flags: needinfo?(hiikezoe)

Comment 4

2 years ago
s/knot/know/
That's because in current implementation, a buffer, which is limited to the max resource timing buffer size (it's 150 by default), for user-timing APIs is shared by all user-timing APIs.
In the example case, each performance.mark/measure consumes the same buffer.  We should not limit the buffer size of user-timing API.  I've already filed bug 1159003 for the limitation issue.
Depends on: 1159003
Flags: needinfo?(kyle)
Flags: needinfo?(hiikezoe)
You need to log in before you can comment on or make changes to this bug.