-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Use LMDB as a cache backend #5509
Conversation
This pull request has been linked to and will mark 1 task as "Done" when merged:
|
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached Bundles
AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
|
# Conflicts: # packages/core/core/src/requests/AssetGraphRequest.js # yarn.lock
Causes serializer errors otherwise
Co-authored-by: Niklas Mischkulnig <[email protected]>
I tried this out on a large app, and got this after a few transformations:
|
c2f6ac5
to
4b4ce35
Compare
# Conflicts: # packages/core/cache/package.json # packages/core/cache/src/Cache.js # yarn.lock
), | ||
); | ||
|
||
// TODO: don't replace hash references in binary files?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this wasn't introduced by your changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah just a problem I noticed. But not sure how to know which files we should do this for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use this in the data url optimizer, but its detection logic is rather sketchy : gjtorikian/isBinaryFile#22
This implements support for multiple cache backends, and adds an LMDB based implementation. LMDB is a very fast embedded key/value store written in C. Rather than write each cache entry to the file system separately, it uses one large memory-mapped file which is asynchronously written to disk. Overall this results in ~15% faster builds, and is even faster than using our own MemoryFS instead of NodeFS.
This PR automatically enables the LMDB-based cache when using a NodeFS, otherwise it falls back to the existing FS-based cache implementation.
Close T-265