Needle: A DFA Based Regex Library That Compiles to JVM ByteCode

The author shares how Kragen’s past complaint about Java regex performance led to the creation of needle, a library that compiles regex to JVM bytecode, making matches more efficient. The author includes benchmarks showcasing how needle compares to the Java standard library and the brics automaton library for different types of regex patterns. While needle is slower than brics for certain patterns, it outperforms the standard library. The author plans to further optimize needle by improving the core loop speed and exploring ways to match or exceed brics’ performance. This reveals the potential for needle to compete with any other regex library.

https://justinblank.com/experiments/needle.html

To top