Using exceptions for flow control is slow, even for DateTimeFormatter
Last week, I reviewed a seemingly simple patch to an Apache Crunch pipeline. Functional details don’t matter, but the pipeline processes loads of hits from HTTP proxies. Hits have a timestamp and the patch aims to enrich every hit with some metadata indexed by user and business date (ie. we query a repository with a composite key, part of it is the date formatted as a yyyyMMdd string). Functional requirements are clear, the code is simple and the repository is more than fast enough to not affect the performance profile of the pipeline...