Improve runtime performance of no-op compilations
Currently, no-op compilation for targets with a large classpath can sometimes be slow. The profile below hints that slow no-op compilation is bottlenecked by java.io.File.isDirectory(), which invokes the native system call stat64
Full profile: nop.svg.zip
It would be nice to use alternative native APIs to testing which files are directories. For example, https://github.com/swoval/swoval.
Thanks for reporting! Yes, I've wanted to use swoval for a few weeks now. We should avoid expensive stat64 operations as much as possible to speed up no-op compilations, class path hashing and other IO-intensive tasks the compilation engine.
I don't think I'll have the time to look into this any time soon but I'm very open to accepting PRs contributing this feature. I'd recommend going through all the call-sites of isDirectory in the codebase and replacing them with swoval APIs.
Paging @eatkins in case he wants to be in the loop.
I’d be happy to provide guidance and PR feedback but I’m mostly taking a break from open source right now.