mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
8f9becee76
This commit removes compression for the runtime JS code.
It means that we will have a bigger binary, but faster startup. After
several discussion in the CLI team we decided it's worth to trade
about 3Mb of binary size for 2ms faster startup time. With WebGPU
removed in 35196eab27
it shouldn't have such a big impact on the binary size.
22 lines
851 B
Rust
22 lines
851 B
Rust
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
#[cfg(not(feature = "dont_create_runtime_snapshot"))]
|
|
use deno_core::Snapshot;
|
|
#[cfg(not(feature = "dont_create_runtime_snapshot"))]
|
|
use log::debug;
|
|
|
|
#[cfg(not(feature = "dont_create_runtime_snapshot"))]
|
|
static RUNTIME_SNAPSHOT: &[u8] =
|
|
include_bytes!(concat!(env!("OUT_DIR"), "/RUNTIME_SNAPSHOT.bin"));
|
|
|
|
#[cfg(not(feature = "dont_create_runtime_snapshot"))]
|
|
pub fn deno_isolate_init() -> Snapshot {
|
|
debug!("Deno isolate init with snapshots.");
|
|
Snapshot::Static(RUNTIME_SNAPSHOT)
|
|
}
|
|
|
|
#[cfg(not(feature = "include_js_files_for_snapshotting"))]
|
|
pub static SOURCE_CODE_FOR_99_MAIN_JS: &str = include_str!("js/99_main.js");
|
|
|
|
#[cfg(feature = "include_js_files_for_snapshotting")]
|
|
pub static PATH_FOR_99_MAIN_JS: &str =
|
|
concat!(env!("CARGO_MANIFEST_DIR"), "/js/99_main.js");
|