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

Translate Java solution to Clojure #56

Merged
merged 1 commit into from
Oct 18, 2022
Merged

Translate Java solution to Clojure #56

merged 1 commit into from
Oct 18, 2022

Conversation

serioga
Copy link
Contributor

@serioga serioga commented Oct 18, 2022

No description provided.

@niklas-heer
Copy link
Owner

Very interesting results. It made Clojure faster, but Clojure via Babashka slower 🤔 😅
combined_results

@niklas-heer niklas-heer merged commit dad8bf7 into niklas-heer:master Oct 18, 2022
@niklas-heer
Copy link
Owner

@serioga thank you very much for your contribution!
In general, I think I choose speed improvements done to the "main implementation" of a language rather than something like Babashka and PyPy.

@serioga
Copy link
Contributor Author

serioga commented Oct 18, 2022

Hm, still slower then I expected.
Need to check benchmark methodogy...

@serioga serioga deleted the patch-1 branch October 18, 2022 18:45
@serioga
Copy link
Contributor Author

serioga commented Oct 18, 2022

Probably you measure app starting time, which is slower for Clojure comparing to Java

@niklas-heer
Copy link
Owner

@serioga yes that is correct, currently startup and IO are included. There are some thoughts (#59) of getting "clean" data just for computing pi, but nothing is implemented yet.

@serioga
Copy link
Contributor Author

serioga commented Oct 18, 2022

OK, but for Clojure those figures are misleading :-)

@serioga
Copy link
Contributor Author

serioga commented Oct 18, 2022

In my tests this code was executed in about 400 ms.
And previous one was about 2500 ms.
Also Java warms up and works faster after this :-)

@niklas-heer
Copy link
Owner

It depends on what you use Clojure for. For a long-running application, I agree. For a CLI application which is invoked from time to time, it's closer to what can be expected, imho.

@niklas-heer
Copy link
Owner

I think that is why I would like to capture both data with startup and IO and just plain pi calculation in the future.

@serioga
Copy link
Contributor Author

serioga commented Oct 18, 2022

I would test nbb for CLI application.
Also I would test something more long running (what requires tens seconds) to reduce significance of startup time.
For startup time I would make separate test with zero op script, to measure which solutions are faster for launching short-term CLI apps.

@giordano
Copy link
Contributor

Note that we had been advocating for this kind of changes in #13, #22, #35, etc... 🙂

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 this pull request may close these issues.

3 participants