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

Add benchmarks to Universum #21

Closed
chshersh opened this issue Nov 2, 2016 · 8 comments
Closed

Add benchmarks to Universum #21

chshersh opened this issue Nov 2, 2016 · 8 comments

Comments

@chshersh
Copy link
Contributor

chshersh commented Nov 2, 2016

I suppose some functions should be benchmarked in order to investigate their performance and to see that we don't have some drawbacks.

First canditate: it may be good to add hashNub function near ordNub. Because it may be more efficient.

@chshersh
Copy link
Contributor Author

This benchmark shows that sometimes it make more sense to use hashNub function instead or implement ordNub in a different way to make more profit: https:/ChShersh/effective-haskell/tree/master/nub

@chshersh
Copy link
Contributor Author

We must consider reading carefully all pragmas and fixing (adding) them appropriately according to this tutorial: http://mpickering.github.io/posts/2017-03-20-inlining-and-specialisation.html

@vrom911
Copy link
Contributor

vrom911 commented Oct 13, 2017

@chshersh I would like to try myself in this one. But before that I would like to clarify what benchmarks need to be implemented additionally to hashNub and ordNub?

@chshersh
Copy link
Contributor Author

@vrom911 Thanks for help with this issue! Currently I see only next set of benchmarks:

Leaving only unique elements in the list:

  1. Stable nubbing: nub ordNub hashNub
  2. Unstable nubbing: Set.toList . Set.fromList map head . group . sort

If I come up with more suggestions or anyone wants to benchmark something else, this list will be extended.

@Martoon-00
Copy link
Member

Martoon-00 commented Oct 15, 2017

How about:
3. Check whether (...) usage spoils performance when applied to many-arguments function, comparing to plain ways of function application
4. concatMapM vs concatMap when used monad is Identity - (?)

@vrom911
Copy link
Contributor

vrom911 commented Oct 17, 2017

@Martoon-00 , thank for your suggestions!
I have a question about (...) operator. I don't see a good way to benchmark it, how do you think it could be done? Will we observe difference on some small examples, and how to come to bigger examples for that?

@Martoon-00
Copy link
Member

Well, nice question )
I suppose, that if no difference is observed on very small examples, you have two ways of extension: apply resulting function to more arguments and apply (...) more times. If, say, 10 usages of (...) x application to 10 arguments doesn't increase time much (time stays within measurement error, my hope in that it will be enough), then we don't care in practice about possible further performance penult.

Does it sound reasonable?

@vrom911
Copy link
Contributor

vrom911 commented Oct 17, 2017

Fair enough. Thank you! :) Will try to implement that.

chshersh added a commit that referenced this issue Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants