Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created February 8, 2022 00:55
Show Gist options
  • Select an option

  • Save alexcrichton/e981b340c2ec6afa67da6023743ac1ab to your computer and use it in GitHub Desktop.

Select an option

Save alexcrichton/e981b340c2ec6afa67da6023743ac1ab to your computer and use it in GitHub Desktop.
diff --git a/benches/instantiation.rs b/benches/instantiation.rs
index ada6f22c8..4a44737ec 100644
--- a/benches/instantiation.rs
+++ b/benches/instantiation.rs
@@ -171,6 +171,7 @@ fn bench_instantiation(c: &mut Criterion) {
"small_memory.wat",
"data_segments.wat",
"wasi.wasm",
+ "rustpython.wasm",
];
for module in modules {
let mut path = PathBuf::new();
diff --git a/crates/runtime/src/instance/allocator/pooling.rs b/crates/runtime/src/instance/allocator/pooling.rs
index 986ec9797..5be6e1bb3 100644
--- a/crates/runtime/src/instance/allocator/pooling.rs
+++ b/crates/runtime/src/instance/allocator/pooling.rs
@@ -364,8 +364,8 @@ impl InstancePool {
// Ensure the instance memory is present.
let instance = self.instance(index);
- commit_instance_pages(instance as *mut Instance as *mut u8, self.instance_size)
- .map_err(|e| InstantiationError::Resource(e.into()))?;
+ // commit_instance_pages(instance as *mut Instance as *mut u8, self.instance_size)
+ // .map_err(|e| InstantiationError::Resource(e.into()))?;
// Instances are uninitialized memory at first; we need to
// write an empty but initialized `Instance` struct into the
@@ -399,7 +399,7 @@ impl InstancePool {
// will use either madvise(MADV_DONTNEED) (on Linux) or
// mmap-of-fresh-anonymous-memory to efficiently zero the
// instance state.
- initialize_vmcontext(instance, req, /* pre_zeroed = */ true);
+ initialize_vmcontext(instance, req, /* pre_zeroed = */ false);
Ok(InstanceHandle {
instance: instance as _,
@@ -515,8 +515,8 @@ impl InstancePool {
// that were mapped. On the next touch (when this slot is
// reused), freshly zeroed pages will be demand-paged in by
// the kernel.
- decommit_instance_pages(instance as *mut Instance as *mut u8, self.instance_size)
- .expect("Could not decommit instance; fatal error");
+ // decommit_instance_pages(instance as *mut Instance as *mut u8, self.instance_size)
+ // .expect("Could not decommit instance; fatal error");
self.index_allocator.lock().unwrap().free(SlotId(index));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment