Skip to content
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

ServerResponseTime should use lognormal CDF and not threshold value #11882

Closed
koraa opened this issue Dec 23, 2020 · 5 comments
Closed

ServerResponseTime should use lognormal CDF and not threshold value #11882

koraa opened this issue Dec 23, 2020 · 5 comments

Comments

@koraa
Copy link

koraa commented Dec 23, 2020

ServerResponseTime currently uses a piecewise mapping from raw value (response time) to score:

scoreFromRaw = (responseTime) => Number(responseTime < TOO_SLOW_THRESHOLD_MS)

This sort of threshold value is undesirable as arbitrarily small changes in response time may lead to a jump in the score (and thus drastically increased variance). It is hard to see why a response time of 500 ms is much worse than a response time of 499ms.

Even if an empirical distribution cannot be determined for ServerResponseTime, you could eyeball a relatively good approximation (e.g. p10=500, median=520) which would yield a pretty good score at 500, a perfect score around 480 and an abysmal score at 550 already.

@patrickhulce
Copy link
Collaborator

Thanks for filing @koraa! The reason for the threshold here is that due to the way DevTools throttling operates, any values below the threshold are not actually observable to Lighthouse. Even sites that returned in 5ms will appears as though they are taking at least 562.5ms. We agree a smooth curve from a much lower value up to 500 would be far more preferable but there simply wouldn't be any interesting signal in the differences in those scores (in addition to failing a large chunk of fast servers).

@koraa
Copy link
Author

koraa commented Jan 19, 2021

Thank you! I didn't know that!

Would it be possible to augment dev tools somehow?

@patrickhulce
Copy link
Collaborator

What sort of augmentation are you thinking?

If the root ask is to fix the throttling issues in Chromium, I don't think that's likely. from what I know it's a very large multi-quarter effort that no one here is equipped to tackle in the forseeable future. Getting a smoother server response time curve isn't exactly high on the list of reasons to justify it either ;)

@koraa
Copy link
Author

koraa commented Jan 19, 2021

OK, sure that makes sense. Should I close the issue or leave it for $sometime.

@patrickhulce
Copy link
Collaborator

We can close for now. If it ever becomes feasible or anyone becomes aware of changes to throttling that make this possible again we'll happily reopen :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants