Install state file#998
Conversation
Fixes the serialization / hydratation
|
@arcanis as discussed there #990 (comment) I took a more brutal approach. The interesting stuff is in However once again I am stuck. I thought this approach would be straightforward enough for me to manage it, but nope! It seems that restoring |
|
When dumping the loaded content I see that |
|
Also of note: the file is 10M for our repository, I can't imagine what it will be for yours π¬ Maybe some basic format packing optimizations would be a good idea (I think ideally it shouldn't be much more than 1MB for our repo, given that the lockfile is 800KB). |
The time in
There isn't at the moment, but I'm fine if you add a private field to
Not needed anymore, let's remove it.
That seems about right. The code is formatted very differently from the rest of the app so I'll likely make a pass to uniformize it, but the logic itself looks fine. |
|
Ok, finished! I now write/control the checksum of the lockfile + installStateFileVersion before writing/reading the install state file. It adds 1-3ms depending on the project, so nothing much. It looks like this Let me know what you think @arcanis , change the code style if you like, and let's get this merged! |
|
Results of the stress test: It's very good! It looks like this: Which is much better than it was before with #990 : (note the different vertical axis): |
f8d8bb0 to
96c8397
Compare
|
I had a look at the branch, it looks good to me |
96c8397 to
61ca9e4
Compare
It was nice for testing but a bit out of place in the end :-) Co-Authored-By: Kristoffer K. <merceyz@users.noreply.github.com>
|
πππ Thanks @crubier! |
|
Thank you so much @arcanis for supporting me through this! My first contribution to yarn, and a lifesaver for my company's tech team, reducing our install and build times by a lot! Best π |
gitignore changes copied from yarnpkg/berry#998.


What's the problem this PR addresses?
#973
How did you fix it?
A bit more brutally than in #990
Here we save the whole project state in one big file so there are no resolution to be done at run time.