« Previous | Next » 

Revision 7570569e


Added by Iustin Pop about 13 years ago

Improve the standard deviation computation

This does just two passes, instead of three, over the list. This reduces
the overall runtime well enough (~25%) in some tests, but it's not
reproducible using profiling, so I don't know how much the function
itself is being sped-up.

Note: this is written via `seq`s, and not BangPatterns. Since it's just
one case, adding BangPatterns just for it wasn't a big gain.

Thanks to Lécz Balázs for the impetus to improve this!

Signed-off-by: Iustin Pop <>
Reviewed-by: Balazs Lecz <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences