Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output the probability of being faster (slower) when compare results #22

Open
serhiy-storchaka opened this issue Mar 9, 2017 · 5 comments

Comments

@serhiy-storchaka
Copy link
Contributor

When compare two results it would be helpful to output a probability of one result be faster then other.

If times1 and times2 are sets of measured times, then the probability of the first benchmark being faster than the second one is estimated as:

sum(x < y for x in times1 for y in times2)/len(times1)/len(times2)

Actually you can sort one of sets and use binary search for optimization.

@vstinner
Copy link
Member

vstinner commented Mar 9, 2017 via email

@serhiy-storchaka
Copy link
Contributor Author

serhiy-storchaka commented Mar 9, 2017

No, it works for different numbers of samples. The formula itself has the computational complexity O(n*m), but may be optimized to O(n*log(m)) if use binary search or even to linear O(n+m). First try the simplest formula and optimize it if it is too slow.

@serhiy-storchaka
Copy link
Contributor Author

The estimated error of the probability estimation p is about:

sqrt(p*(1-p)/len(times1)/len(limes2))

@vstinner
Copy link
Member

@serhiy-storchaka would you be interested to write a pull request to implement this idea?

@sweeneyde
Copy link

I opened #118. Is there still interest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants