You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we log an error if there is more than one performance.measure entry for a given name and pick the first one:
WARNING: Found multiple performance marks/measurements with name "update". This likely indicates an error. Picking the first one.
However there are cases where we want to accumulate time e.g. inside a loop, while excluding non-relevant loop overhead, e.g.:
for(leti=0;i<1000;i++){// Don't want to include this expensive operation in the measurementconstdata=generateData();performance.mark('render-start');// Only want to measure thisrender(template(data),container);performance.measure('render','render-start');}
In this case, it seems fine to sum all of the performance.getEntriesByName('render') durations (for entryType === 'measure' only; the other measurement types are points in time and wouldn't make sense to sum) and report that. However, this wouldn't be safe as there's currently no good signal for tachometer to know when to stop polling, since it once the first measurement(s) show up it would use it, regardless of whether there were more coming.
Maybe we could consider an optional sentinel tachometer-done mark that tachometer polls for (existence only) before collecting all the entries?
The text was updated successfully, but these errors were encountered:
Currently we log an error if there is more than one
performance.measure
entry for a given name and pick the first one:However there are cases where we want to accumulate time e.g. inside a loop, while excluding non-relevant loop overhead, e.g.:
In this case, it seems fine to sum all of the
performance.getEntriesByName('render')
durations (forentryType === 'measure'
only; the other measurement types are points in time and wouldn't make sense to sum) and report that. However, this wouldn't be safe as there's currently no good signal for tachometer to know when to stop polling, since it once the first measurement(s) show up it would use it, regardless of whether there were more coming.Maybe we could consider an optional sentinel
tachometer-done
mark that tachometer polls for (existence only) before collecting all the entries?The text was updated successfully, but these errors were encountered: