Skip to content
Snippets Groups Projects
Commit e6f4f05c authored by Iustin Pop's avatar Iustin Pop
Browse files

Optimize the Utils.stdDev function

This patch optimizes the stdDev function in two respects:
  - first, we don't do sum . map which builds an intermediate list, but
	instead use a fold over the list to build incrementally the sum;
	this should reduce both the time and space characteristics, as we
	have fewer objects created
  - second, we move from “a ^ 2” to “a * a” as the latter has a much
	simpler implementation and thus a higher performance

Since the ‘square’ function is obsoleted by the above the patch also
removes it.
parent d71d0a1d
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment