-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize
AvailableInstantiations::update
(#216)
* Optimize `AvailableInstantiations::update` The previous implementation of this function was quite naive and went to no lengths to be optimized. This is unfortunately causing timeouts on OSS-Fuzz, however, so this commit applies the requisite optimizations to get this to run quickly on oss-fuzz. The purpose of this method is to keep track of all possible instantiations that a module can make, maintaining a list of modules and the arguments which can be provided to the module to instantiate it. The previous implementation simply cleared all state and figured this out from scratch on every iteration, so if there were lots of items this would take an exponential amount of time to complete. This PR changes the `update` method to be incremental. It keeps track of all processed items and only visits each candidate in a module once-per-module-to-instantiate, which drives down the cost of this method significantly. The incremental update should be relatively easily (hopefully) to reason about as well by simply visiting newer items for each time `update` is called. * Update crates/wasm-smith/src/lib.rs Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com> Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
- Loading branch information
1 parent
bf78e07
commit 33e28d0
Showing
1 changed file
with
56 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters