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

filiphr first submission #12

Merged
merged 5 commits into from
Jan 3, 2024
Merged

Conversation

filiphr
Copy link
Contributor

@filiphr filiphr commented Jan 2, 2024

Really interesting and fun challenge @gunnarmorling.

I gave it a go, first implementation using Shenandoah GC (reduces GC pauses significantly) and uses parallel iteration.

My implementation is: [CalculateAverage_filiphr.java]
I used OpenJDK Runtime Environment Zulu21.30+15-CA (build 21.0.1+12-LTS) (21.0.1-zulu)

On Macbook Pro (8 core Intel 64 GB RAM) it runs in +/- 1m40s, the reference implementation runs in +/- 4m9s

@gunnarmorling
Copy link
Owner

Nice one, thanks a lot! Will evaluate this one tomorrow, first need to install that Zulu JDK.

@filiphr
Copy link
Contributor Author

filiphr commented Jan 2, 2024

Thanks. It doesn't have to be Zulu though. It needs a JDK that has Shenandoah GC, the ones provided by Oracle do not have it (Graal, Oracle JDK and Open JDK). Zulu, Temurin, RedHat, SAP have it (in case it is easier for you to use one of the others)

@lobaorn
Copy link

lobaorn commented Jan 3, 2024

Hey @filiphr considering that the builds from https://builds.shipilev.net/ are now permitted, do you think it would be interesting to use a variation of the Shenandoah builds?

So you would be able to compare the difference between a "stock" JVM from one build of the Shenandoah branch itself, with perhaps some tuning that is currently not available outside.

@filiphr
Copy link
Contributor Author

filiphr commented Jan 3, 2024

Hey @lobaorn, it would for sure be interesting to try out a different build from https://builds.shipilev.net/. Which one will you suggest me to try out?

I've been also working on using memory mapped files locally and it seems like the GC is not making any special differences now.

@lobaorn
Copy link

lobaorn commented Jan 3, 2024

In Twitter/X @shipilev told to just use the default release tags for the builds, so in this case using Docker to facilitate (https://hub.docker.com/r/shipilev/openjdk/tags) would be probably in the direction of the Shenandoah build, and try with the generational experimental feature/flag to check if it offers an improvement, or in the direction of the Lilliput build using Generational ZGC and perhaps follow the tuning suggestions of @fisk here aboug GenZGC: #15 (comment)

So there are at least two different directions of using the builds, I would assume.

@filiphr
Copy link
Contributor Author

filiphr commented Jan 3, 2024

Thanks @lobaorn, I'll check Twitter and the Comments in #15 as well.

I've done some rework on this using memory mapped files thanks @bjhara and @royvanrijn for their submissions, I learned something new.

Changed to use BigDecimal parsing instead of Double.parseBoolean, that improves a bit the speed as well.

With the updates it now runs in ~35s on my machine

@filiphr
Copy link
Contributor Author

filiphr commented Jan 3, 2024

If I change to using Graal 21.0.1 (sdk use java 21.0.1-graal) then it takes ~16s on my machine.

@gunnarmorling
Copy link
Owner

@filiphr, if any of the distros available from SDKMan can be used, could you add a line like this to your launch script?

@filiphr
Copy link
Contributor Author

filiphr commented Jan 3, 2024

@gunnarmorling, done. I've added sdk use java 21.0.1-graal. Using the Graal CE edition makes no difference for me.

If it isn't possible to use Oracle GraalVM (it is available on SDKMan) then it is fine to just run this with the default JDK

@gunnarmorling
Copy link
Owner

Nice, 00:21.853! 4th place rn!

@gunnarmorling gunnarmorling merged commit d57cf78 into gunnarmorling:main Jan 3, 2024
@filiphr filiphr deleted the submission branch January 3, 2024 20:26
@filiphr
Copy link
Contributor Author

filiphr commented Jan 3, 2024

Nice, thanks for merging it. Such a fun experience. Will try to speed it up a bit more :)

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