paulirish / speedline

Calculate the speed index from devtools performance trace
MIT License
796 stars 44 forks source link

SpeedIndex reported as 0 on sites with <=3 frames #21

Closed paulirish closed 8 years ago

paulirish commented 8 years ago

We're seeing some cases where speedindex is reporting 0. Typically happens with sites like airhorner.com and example.com which are very simple and may have only a few frames..

We've seen these sorts of results:

{
  'frames': [...],
  'first': 352,
  'complete': 352,
  'duration': 3417,
  'speedIndex': 352
}
{
  'frames': [...],
  'first': 310,
  'complete': 310,
  'duration': 3366,
  'speedIndex': 0
}

cc @brendankenny

paulirish commented 8 years ago

Over in https://github.com/pmdartus/speedline/commit/9e6436133e51d11bd872cfb4a330ebf47160354f I added a few test cases for 1, 2, and 3 frame traces that are hard for speed index to reason about.

paulirish commented 8 years ago

I've also started a branch that separates out our first/last frames in the object we pass around, so it's more clear which frame we're using.

https://github.com/paulirish/speedline/compare/screenshotevents...paulirish:oneframetraces