https://github.com/pez/ghost-chase-condition
Chasing a performance-eating ghost down the JVM rabbit hole
https://github.com/pez/ghost-chase-condition
clojure java jvm performance sieve-of-eratosthenes
Last synced: about 1 month ago
JSON representation
Chasing a performance-eating ghost down the JVM rabbit hole
- Host: GitHub
- URL: https://github.com/pez/ghost-chase-condition
- Owner: PEZ
- License: mit
- Created: 2022-02-01T10:55:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-10T07:58:30.000Z (about 3 years ago)
- Last Synced: 2025-01-26T04:25:18.230Z (3 months ago)
- Topics: clojure, java, jvm, performance, sieve-of-eratosthenes
- Language: Java
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ghost-chase-condition
Following a performance-eating ghost down the JVM rabbit hole.
Please see [this blog post](https://blog.agical.se/en/posts/java-bitset-performance-mystery) for an introduction to the mystery.
TL;DR: The same `javac` compiled program runs at two different speeds: 1X and 0.5X, on the same machine, using Docker. I've managed to create a somewhat minimal repro.
To run the repro:
```
docker build -t primes-java-bitset . && docker run --rm -it primes-java-bitset
```Sample output on [this machine](machine-pez-x64-ubuntu.md):
```
0 - Passes: 2767, count: 78498, Valid: true
1 - Passes: 2751, count: 78498, Valid: true
2 - Passes: 2766, count: 78498, Valid: true
3 - Passes: 2756, count: 78498, Valid: true
4 - Passes: 6049, count: 78498, Valid: true
5 - Passes: 2763, count: 78498, Valid: true
6 - Passes: 2765, count: 78498, Valid: true
7 - Passes: 2760, count: 78498, Valid: true
8 - Passes: 6043, count: 78498, Valid: true
9 - Passes: 2760, count: 78498, Valid: true
```I'm getting some good help over at HN: https://news.ycombinator.com/item?id=30226083