Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Better Bf2 Java implementation. #173
This PR implements brainfuck2 in Java that runs much faster than the current implementation.
The code is still pretty clean and very readable, besides being more testable.
On my system, here are the figures I am getting comparing the new implementation with the current one, as well as with the Kotlin (current fastest in the project README) implementation:
The Kotlin implementation is also not optimal, I will make a PR offering a faster implementation for it as well.
I need to clarify that the times I posted above is when running Java 8 with the GraalVM's JIT.
On the Oracle JVM, there's a performance issue with the Java version, so it runs much slower than Kotlin.
Here's my data:
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
OpenJDK 64-Bit GraalVM CE 19.0.2 (build 25.212-b03-jvmci-19-b04, mixed mode)
So, the performance depends a lot on which JIT is used for Java.