From 7f3902b41f68edddbc50b01ea52c697827d8516f Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 15 Nov 2023 04:25:55 -0800 Subject: perf: static bootstrap options in snapshot (#21213) Closes https://github.com/denoland/deno/issues/21133 --- runtime/js/99_main.js | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'runtime/js/99_main.js') diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 76a279bbd..89296d632 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -450,6 +450,13 @@ const finalDenoNs = { ...denoNs, }; +const { + denoVersion, + tsVersion, + v8Version, + target, +} = ops.op_snapshot_options(); + function bootstrapMainRuntime(runtimeOptions) { if (hasBootstrapped) { throw new Error("Worker runtime already bootstrapped"); @@ -457,16 +464,12 @@ function bootstrapMainRuntime(runtimeOptions) { const nodeBootstrap = globalThis.nodeBootstrap; const { - 0: denoVersion, - 1: location_, - 2: tsVersion, - 3: unstableFlag, - 4: unstableFeatures, - 5: target, - 6: v8Version, - 7: inspectFlag, - 9: hasNodeModulesDir, - 10: maybeBinaryNpmCommandName, + 0: location_, + 1: unstableFlag, + 2: unstableFeatures, + 3: inspectFlag, + 5: hasNodeModulesDir, + 6: maybeBinaryNpmCommandName, } = runtimeOptions; performance.setTimeOrigin(DateNow()); @@ -583,16 +586,12 @@ function bootstrapWorkerRuntime( const nodeBootstrap = globalThis.nodeBootstrap; const { - 0: denoVersion, - 1: location_, - 2: tsVersion, - 3: unstableFlag, - 4: unstableFeatures, - 5: target, - 6: v8Version, - 8: enableTestingFeaturesFlag, - 9: hasNodeModulesDir, - 10: maybeBinaryNpmCommandName, + 0: location_, + 1: unstableFlag, + 2: unstableFeatures, + 4: enableTestingFeaturesFlag, + 5: hasNodeModulesDir, + 6: maybeBinaryNpmCommandName, } = runtimeOptions; performance.setTimeOrigin(DateNow()); -- cgit v1.2.3