A developer building a Google Photos clone walks through converting single-threaded image thumbnail generation to multi-threaded using Java. Key discoveries include a Java bug where parallel file streams were not actually parallel before Java 19, and the fix using ExecutorService with a fixed thread pool sized to available CPUs. Benchmarks show 357 images processed in 45 seconds vs 72 seconds single-threaded. The episode also covers using Blake3 hashing for thumbnail filenames and a Git-inspired subdirectory structure to avoid filename collisions, with WebP as the output format.
•17m watch time
Sort: