Vertispan / j2clmavenplugin

Maven plugin to launch new J2CL compilation
https://vertispan.github.io/j2clmavenplugin/
Apache License 2.0
53 stars 26 forks source link

Lock contention issue with medium-large projects and populated cache #213

Open niloc132 opened 1 year ago

niloc132 commented 1 year ago

DiskCache.waitForTask calls ConcurrentHashMap.computeIfAbsent, and inside of the lambda for a populated cache, makeOutput() will be called. This calls hashContents(), which is roughly IO bound, and means that any other threads have to wait to potentially begin work.

Naive answer would be to move that IO work off-thread or out of the lock, but the simplest answer is likely to just write down the cache details, as #176 is already doing, and read the hash from disk for each file, rather than re-hashing each file.