Skip to content

Commit

Permalink
perf(compile): pass module source data from binary directly to v8 (#2…
Browse files Browse the repository at this point in the history
…6494)

This changes denort to pass a static reference of the moude source bytes found in the binary to v8 instead of copying it.
  • Loading branch information
dsherret authored Oct 24, 2024
1 parent ea64189 commit eedf243
Show file tree
Hide file tree
Showing 14 changed files with 1,149 additions and 482 deletions.
35 changes: 1 addition & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ deno_runtime = { workspace = true, features = ["include_js_files_for_snapshottin
deno_semver.workspace = true
deno_task_shell = "=0.18.1"
deno_terminal.workspace = true
eszip = "=0.79.1"
libsui = "0.4.0"
node_resolver.workspace = true

Expand Down
1 change: 1 addition & 0 deletions cli/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl Emitter {
continue;
};

// todo(https://github.com/denoland/deno_media_type/pull/12): use is_emittable()
let is_emittable = matches!(
module.media_type,
MediaType::TypeScript
Expand Down
1 change: 1 addition & 0 deletions cli/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ impl CliFactory {
let cli_options = self.cli_options()?;
Ok(DenoCompileBinaryWriter::new(
self.deno_dir()?,
self.emitter()?,
self.file_fetcher()?,
self.http_client_provider(),
self.npm_resolver().await?.as_ref(),
Expand Down
9 changes: 4 additions & 5 deletions cli/mainrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@ fn main() {
let standalone = standalone::extract_standalone(Cow::Owned(args));
let future = async move {
match standalone {
Ok(Some(future)) => {
let (metadata, eszip) = future.await?;
util::logger::init(metadata.log_level);
load_env_vars(&metadata.env_vars_from_env_file);
let exit_code = standalone::run(eszip, metadata).await?;
Ok(Some(data)) => {
util::logger::init(data.metadata.log_level);
load_env_vars(&data.metadata.env_vars_from_env_file);
let exit_code = standalone::run(data).await?;
std::process::exit(exit_code);
}
Ok(None) => Ok(()),
Expand Down
Loading

0 comments on commit eedf243

Please sign in to comment.