diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-12-02 21:21:33 +0100 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-12-02 12:21:32 -0800 |
commit | 136b5e3da2c689b54b34c46fa41973e0ccca66ab (patch) | |
tree | 937a5884c783023b36a2d535b31121b3773ec47e /core/isolate.rs | |
parent | 2ed3592def992a094d61d40db0569ac2fecb402f (diff) |
disable eager polling for ops (#3434)
Diffstat (limited to 'core/isolate.rs')
-rw-r--r-- | core/isolate.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/core/isolate.rs b/core/isolate.rs index 41c8b02fd..06abfc0ef 100644 --- a/core/isolate.rs +++ b/core/isolate.rs @@ -179,7 +179,6 @@ pub struct Isolate { have_unpolled_ops: bool, startup_script: Option<OwnedScript>, pub op_registry: Arc<OpRegistry>, - eager_poll_count: u32, waker: AtomicWaker, } @@ -246,7 +245,6 @@ impl Isolate { pending_dyn_imports: FuturesUnordered::new(), startup_script, op_registry: Arc::new(OpRegistry::new()), - eager_poll_count: 0, waker: AtomicWaker::new(), } } @@ -349,29 +347,6 @@ impl Isolate { } }; - // To avoid latency problems we eagerly poll 50 futures and then - // allow to poll ops from `pending_ops` - let op = if isolate.eager_poll_count != 50 { - isolate.eager_poll_count += 1; - match op { - Op::Async(mut fut) => { - // Tries to eagerly poll async ops once. Often they are immediately ready, in - // which case they can be turned into a sync op before we return to V8. This - // can save a boundary crossing. - #[allow(clippy::match_wild_err_arm)] - let mut cx = Context::from_waker(futures::task::noop_waker_ref()); - match fut.poll_unpin(&mut cx) { - Poll::Ready(Err(_)) => panic!("unexpected op error"), - Poll::Ready(Ok(buf)) => Op::Sync(buf), - Poll::Pending => Op::Async(fut), - } - } - Op::Sync(buf) => Op::Sync(buf), - } - } else { - op - }; - debug_assert_eq!(isolate.shared.size(), 0); match op { Op::Sync(buf) => { @@ -703,7 +678,6 @@ impl Future for Isolate { // Now handle actual ops. inner.have_unpolled_ops = false; - inner.eager_poll_count = 0; #[allow(clippy::match_wild_err_arm)] match inner.pending_ops.poll_next_unpin(cx) { Poll::Ready(Some(Err(_))) => panic!("unexpected op error"), |