Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #4131 - zebambam:defer_expensive_intialization_of_empty…
…_merkle_trees, r=<try> Deferred initialization of EmptyMerklePath structures till first use … …to reduce monolith startup penalty for fuzzing. These structures were previously filled statically at load time. The performance cost of monolith startup even with an alternative main function is significant when you're loading it many times. Notes on the approach to fuzzing (why do this patch?): Yes there are other ways to write fuzzers, but their cost is also higher than necessary. This allows us to access any namespace we need within the monolith and know that at least the build requisites are available without having to do a lot of mocking, shimming, etc.. for each fuzzer. Notes on the structure of the change: Larry convinced me to use "LOCK" in the end, which meant bringing in another header. I've added optimization around the lock so that it's not needed every time. I've added calls to initialize into the comparison operator as well as the accessor. I think that's all the places that are relevant.
- Loading branch information