From fec1b2a5a4324a7eecdfbb2471931f3b6b0139c5 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Wed, 31 Mar 2021 16:37:38 +0200 Subject: refactor: new optimized op-layer using serde_v8 (#9843) - Improves op performance. - Handle op-metadata (errors, promise IDs) explicitly in the op-layer vs per op-encoding (aka: out-of-payload). - Remove shared queue & custom "asyncHandlers", all async values are returned in batches via js_recv_cb. - The op-layer should be thought of as simple function calls with little indirection or translation besides the conceptually straightforward serde_v8 bijections. - Preserve concepts of json/bin/min as semantic groups of their inputs/outputs instead of their op-encoding strategy, preserving these groups will also facilitate partial transitions over to v8 Fast API for the "min" and "bin" groups --- cli/lsp/tsc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli/lsp') diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index e3c094dfa..1e7ae6f89 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -1387,11 +1387,12 @@ fn cache_snapshot( Ok(()) } +// buffer-less json_sync ops fn op(op_fn: F) -> Box where F: Fn(&mut State, V) -> Result + 'static, V: de::DeserializeOwned, - R: Serialize, + R: Serialize + 'static, { json_op_sync(move |s, args, _bufs| { let state = s.borrow_mut::(); -- cgit v1.2.3