size-limit-action icon indicating copy to clipboard operation
size-limit-action copied to clipboard

100% increase when running time is `0 ms`

Open SalimBensiali opened this issue 2 years ago • 2 comments

First of all thanks for this action and the cli tool.

I am noticing a consistent 0 ms (+100% 🔺). Is this expected?

See screen grab below

image

SalimBensiali avatar Jan 19 '23 05:01 SalimBensiali

I found this is due to the case of comparing against an initial value of 0, where coming up with a percentage increase value is tricky. Currently the code reports +100% 🔺. I have raised a PR fix where I think the suggested resolution is an improvement See https://github.com/andresz1/size-limit-action/pull/102. Basically the reported percentage increase will be:

  • 0% if the both the previous and current values are 0, or
  • +∞% 🔺 if the previous value is 0 and the current is not 0

SalimBensiali avatar Jan 26 '23 22:01 SalimBensiali

@andresz1 any thoughts on this?

SalimBensiali avatar Apr 11 '23 02:04 SalimBensiali