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
{{ message }}
Repository navigation
Unknown value of 0 means "assume slow" but example shows "assume fast" #5
The logic for the "unknown" bucket should be left to the app to decide.
"Infinitely slow" and "infinitely fast" are two arbitrary interpretations.
Maybe the latter makes more sense, hence it is used in the example.
But the value 0 should be just treated as a special case.
If an app wants to interpret this as "infinitely fast", what would be the issue with the following code?
No issue for a well written application that is written by a developer who knows to explicitly test.
But given that there is a strict ordering of performance levels, and also that we are proposing adding new buckets over time-- I don't see it likely that a developer would explicitly "switch" on specific performance levels, but instead would use a simple "less than" comparison, and "0" being the smallest feels like the wrong default to me.
The choice might lead to sites unknowingly having disabled functionality, by default, and assume it would not be performance (this is the opposite of what sites do today).
I don't know how commonly a value of 0 would be used, so perhaps this is not a necessary concern.
Activity
nickie commentedon Nov 13, 2025
The logic for the "unknown" bucket should be left to the app to decide.
"Infinitely slow" and "infinitely fast" are two arbitrary interpretations.
Maybe the latter makes more sense, hence it is used in the example.
But the value 0 should be just treated as a special case.
If an app wants to interpret this as "infinitely fast", what would be the issue with the following code?
mmocny commentedon Nov 14, 2025
No issue for a well written application that is written by a developer who knows to explicitly test.
But given that there is a strict ordering of performance levels, and also that we are proposing adding new buckets over time-- I don't see it likely that a developer would explicitly "switch" on specific performance levels, but instead would use a simple "less than" comparison, and "0" being the smallest feels like the wrong default to me.
The choice might lead to sites unknowingly having disabled functionality, by default, and assume it would not be performance (this is the opposite of what sites do today).
I don't know how commonly a value of
0would be used, so perhaps this is not a necessary concern.