summaryrefslogtreecommitdiff
path: root/core/snapshot_util.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-02-20 21:45:34 +0100
committerGitHub <noreply@github.com>2023-02-20 21:45:34 +0100
commit914b08fc19e5c7268e7b04a216337e765d6a06e8 (patch)
tree39f73f4e046346f358d74ff10f62cb2d5f7078a8 /core/snapshot_util.rs
parent4d1a14ca7fa9496f36470a7771448a9b006b0204 (diff)
build: add "include_js_files_for_snapshotting" Cargo feature (#17826)
This allows to not include source code into the binary (because it will already be included in the V8 snapshot). Nothing changes for the embedders - everything should still build the same. This commit brings the binary size from 87Mb to 82Mb on M1. Alternative to https://github.com/denoland/deno/pull/17820 and https://github.com/denoland/deno/pull/17653 --------- Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
Diffstat (limited to 'core/snapshot_util.rs')
-rw-r--r--core/snapshot_util.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/snapshot_util.rs b/core/snapshot_util.rs
index a4bf80227..5b0ba92a0 100644
--- a/core/snapshot_util.rs
+++ b/core/snapshot_util.rs
@@ -33,6 +33,12 @@ pub fn create_snapshot(create_snapshot_options: CreateSnapshotOptions) {
snapshot_module_load_cb: create_snapshot_options.snapshot_module_load_cb,
..Default::default()
});
+ println!(
+ "JsRuntime for snapshot prepared, took {:#?} ({})",
+ Instant::now().saturating_duration_since(mark),
+ create_snapshot_options.snapshot_path.display()
+ );
+ mark = Instant::now();
let snapshot = js_runtime.snapshot();
let snapshot_slice: &[u8] = &snapshot;