From 0cce9c2bcc9667935a571d30847e66ef5d01a196 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 8 Mar 2023 22:21:14 +0530 Subject: feat(core): prevent isolate drop for CLI main worker (#18059) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` Benchmark 1: deno run -A ../empty.js Time (mean ± σ): 20.5 ms ± 0.5 ms [User: 13.4 ms, System: 5.1 ms] Range (min … max): 19.8 ms … 24.0 ms 119 runs Benchmark 2: target/release/deno run -A ../empty.js Time (mean ± σ): 18.8 ms ± 0.3 ms [User: 13.0 ms, System: 4.9 ms] Range (min … max): 18.3 ms … 19.9 ms 129 runs ``` --------- Co-authored-by: Bartek Iwańczuk --- core/ops.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/ops.rs') diff --git a/core/ops.rs b/core/ops.rs index ca465c821..b2442634e 100644 --- a/core/ops.rs +++ b/core/ops.rs @@ -179,6 +179,10 @@ impl OpState { tracker: OpsTracker::new(ops_count), } } + + pub fn clear_state(&mut self) { + self.gotham_state.clear(); + } } impl Deref for OpState { -- cgit v1.2.3