commit | 978799161107c25f597d403bae19287fc04c36f1 | [log] [tgz] |
---|---|---|
author | djasper <djasper@google.com> | Mon Dec 07 11:05:20 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Mon Dec 07 11:06:41 2020 -0800 |
tree | 1ca9e994607120358297af905e7166dcbc110e42 | |
parent | 43a22faff1f07400678bb8bfa80fd676a5aa0748 [diff] |
Reduce contention in PathExistenceCache.directoryExists()/fileExists(). A ConcurrentHashMap locks an entire shard and so with a high job count, we create needless contention here. As per the documentation of ConcurrentHashMap, the computeIfAbsent() implementation needs to be fast which a file stat might not always be. Instead accept that we might be doing the underlying stat multiple times. Another alternative would be to use futures, but experiments suggest that the marginal reduction in stats is not worth the extra complexity and memory overhead. RELNOTES: None. PiperOrigin-RevId: 346133029
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md