-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dedupe calls to performance.measure #10321
Conversation
I'm seeing a different problem that was introduced in v2.0.0.
mapbox-gl-js/src/source/vector_tile_worker_source.js Lines 57 to 59 in 47d8d51
This means it might be delayed significantly for some request types. Fixing this might involve moving the But I'm also not fully sure how this specific metric is used so we should look at that more carefully at some point. |
84b47b9
to
047e383
Compare
047e383
to
9ac1e59
Compare
@@ -214,7 +223,7 @@ class VectorTileWorkerSource extends Evented implements WorkerSource { | |||
if (err || !result) return callback(err); | |||
|
|||
// Transferring a copy of rawTileData because the worker needs to retain its copy. | |||
callback(null, extend({rawTileData: rawTileData.slice(0)}, result, cacheControl, resourceTiming)); | |||
callback(null, extend({rawTileData: rawTileData.slice(0)}, result, cacheControl, this.deduped._resourceTiming)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get rid of the RequestPerformance
class and replace it with a method that does what getMeasurement()
does?
Both here and in geojson_worker_source.js we could do something like this:
_resourceTiming: getResourceTiming(params.request)
and remove the:
- new RequestPerformance()
- the stuff in DedupedRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep 👍 much simpler
Launch Checklist
loadTile
and ultimately toperf.finish()
. On the first call toperf.finish()
, the entries forthis._marks.start
are cleared from the performance entry buffer. On the second call toperf.finish()
,performance.measure()
tries to usethis._marks.start
as the start mark but can't find entries in the performance buffer and throws an error.DedupedRequest
class so that the measurement isn't dependent onthis.scheduler
for timing.mapbox-gl-js
changelog:<changelog>Prevent collectResourceTiming from causing errors when loading vector tiles</changelog>