Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
niloc132 opened this issue Dec 27, 2022 · 0 comments
Open
Assignees
Labels
bug Something isn't working performance

Comments

@niloc132
Copy link
Member

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.

@niloc132 niloc132 added bug Something isn't working performance labels Dec 27, 2022
@niloc132 niloc132 self-assigned this Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance
Projects
None yet
Development

No branches or pull requests

1 participant