-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
core: truncate measure timings to hundredths #7748
Conversation
Wait, wrong timings :) |
4cec797
to
4d1c288
Compare
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.
lighthouse-core/runner.js
Outdated
@@ -180,6 +180,12 @@ class Runner { | |||
// As entries can share a name, dedupe based on the startTime timestamp | |||
].map(entry => /** @type {[number, PerformanceEntry]} */ ([entry.startTime, entry])); | |||
const timingEntries = Array.from(new Map(timingEntriesKeyValues).values()); | |||
for (const timing of timingEntries) { |
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.
add a comment above this loop to explain why this is being done.
lighthouse-core/runner.js
Outdated
@@ -180,6 +180,12 @@ class Runner { | |||
// As entries can share a name, dedupe based on the startTime timestamp | |||
].map(entry => /** @type {[number, PerformanceEntry]} */ ([entry.startTime, entry])); | |||
const timingEntries = Array.from(new Map(timingEntriesKeyValues).values()); | |||
for (const timing of timingEntries) { | |||
// @ts-ignore - ignore readonly | |||
timing.startTime = parseFloat(timing.startTime.toFixed(2)); |
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.
It looks like you may have to make a copy of these in order to do this. Real PerformanceEntry
's properties really do appear to be read only
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.
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.
done
shout out to @wardpeet who made extension-test a thing! that failure was so rad. :D |
hip hip hurray!! @wardpeet is like, the best example of open source awesomeness around 😃 |
Reduces LHR size by ~4KB. That was ~1% of the LHR I tested it with.
Related Issues/PRs
#7160