(edit): https://github.com/oven-sh/bun#why-is-it-binary (though this does not answer the last question, and only partially the second)
(edit): https://github.com/oven-sh/bun#why-is-it-binary (though this does not answer the last question, and only partially the second)
That said, I'm not super convinced that performance would necessitate this; if parsing the text file was really that slow, I think you could instead have a separate binary file created whenever the lockfile is changed that has a serialized representation of the lockfile along with a checksum to ensure that it's not out-of-sync, then hash the lockfile before using the binary representation. I guess it's possible that if the tooling is brittle or people try to edit their lockfile by hand, this might end up detecting an out-of-sync lockfile more often than not, but at that point I think the issue isn't really with the lockfile format.