From 0dc2f02dfa2b299cd8a8d352c880b05be463cf0f Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 17 Oct 2022 03:42:05 -0700 Subject: [PATCH] perf(ext/web): optimize `op_cancel_handle` (#16318) Towards #16315 --- ext/web/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/web/lib.rs b/ext/web/lib.rs index 0eec63ab9f..85e32b70ae 100644 --- a/ext/web/lib.rs +++ b/ext/web/lib.rs @@ -338,8 +338,8 @@ fn op_encoding_encode_into( } /// Creates a [`CancelHandle`] resource that can be used to cancel invocations of certain ops. -#[op] -pub fn op_cancel_handle(state: &mut OpState) -> ResourceId { +#[op(fast)] +pub fn op_cancel_handle(state: &mut OpState) -> u32 { state.resource_table.add(CancelHandle::new()) }