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

any benchmarks #28

Closed
acornejo opened this issue Jun 28, 2015 · 7 comments · Fixed by #29
Closed

any benchmarks #28

acornejo opened this issue Jun 28, 2015 · 7 comments · Fixed by #29

Comments

@acornejo
Copy link
Contributor

Found this project while looking for a c goroutine implementation. It looks wonderful! Are there any benchmarks available?

A sample implementation of the Chinese whisper benchmark would be useful to compare it against go, libtask, etc.

https://cxwangyi.wordpress.com/2012/07/29/chinese-whispers-in-racket-and-go/

@sustrik
Copy link
Owner

sustrik commented Jun 28, 2015

Have a look into "perf" subdirectory.

@acornejo
Copy link
Contributor Author

thanks, I had looked into that folder, but didn't find that particular benchmark. Its not that I believe that particular benchmark has any inherent value, I only wanted to use it because there are implementations of it already floating online for Go, Rust, Racket, Lisp, Haskell, etc.

I just implemented one. The results are both exciting and disappointing at the same time. For values of up to 10,000, libmill seems performs well, in fact in some runs it is faster than go!

Unfortunately, with bigger values it chokes really bad. For 100000 go takes 1.7 seconds on average on my laptop, and I left the libmill version running for minutes without getting an output (so there is probably some sort of deadlock going on).

Will submit a pull-request adding the whispers benchmark to libmill.

@sustrik
Copy link
Owner

sustrik commented Jun 29, 2015

I've fixed couple of bugs and now I get this on my laptop:

sustrik@sustrik-glaptop:~/libmill$ ./perf/whispers 100000
100001
took 0.469000 seconds

Please, confirm.

@acornejo
Copy link
Contributor Author

unfortunately, it still chokes on 100,000.

I let it run until completion, it took 164 seconds.

What operating system are you testing on? I was trying to run on an osx laptop. I just tried it on linux, and there it does complete within a second, so perhaps this is some performance bottleneck caused by clang?

@sustrik
Copy link
Owner

sustrik commented Jun 29, 2015

Unfortunately, I don't own an OSX box. For diagnostic purposes, can you check with gcc on OSX?

@acornejo
Copy link
Contributor Author

unfortunately installing gcc in osx is a PITA.

however, I did the next best thing, I installed clang on my linux box. There I can confirm that libmill works fine with clang 3.4, so this is probably not a compiler thing.

Perhaps this has something to do with the setjmp and longjmp of glibc vs whatever libc osx uses? Or even worse, this could be related to the kernel?

I haven't looked under the hood to see how libmill actually works (may do that next weekend when I get some more spare time), so I can't offer any additional insight.

@sustrik
Copy link
Owner

sustrik commented Jun 29, 2015

My guess would be malloc() rather than set/longjmp().

Easy way to find out: Measure the setup phase (go commands) in whispers separately from message passing phase (chs/chr). If setup is slow, malloc is suspect. If sending is slow, longjmp is.

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

Successfully merging a pull request may close this issue.

2 participants