My code is faster than yours... let me prove it to you!
summary
Code with a redos vulnerability is rewritten as procedural Java, covered by unit tests, and benchmarked with JMH microbenchmarks to prove performance. The iterative replacement beats the regex by about 4–8× faster in these tests and shows the regex slows further as replacements increase (roughly ~50% slower under heavy replacement). Benchmarking uses per-thread state, blackholes, warmups and forks; results, visualizations and a GitHub template repository are provided to replicate the experiment.
AI-written summary · about
chapters (12)
- 0:00Introduction and thanks
- 1:28Introducing myself and talk setup
- 2:31Performance of regular expressions
- 7:57Proving regex is slower
- 10:51Microbenchmarking overview
- 13:58Setting up JMH benchmark
- 21:07Common JMH pitfalls
- 24:34JMH iterations and warmup
- 28:08JMH annotations and modes
- 31:20Running and interpreting results
- 35:29JMH resources and template
- 36:51Q&A session
