Skip to content

Commit

Permalink
Change snapshots, module ids are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rscarson committed Jun 15, 2024
1 parent 0230288 commit bd6614e
Show file tree
Hide file tree
Showing 19 changed files with 559 additions and 195 deletions.
140 changes: 108 additions & 32 deletions Cargo.lock

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

15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ categories = ["web-programming", "network-programming", "api-bindings", "compile
readme = "readme.md"

[features]
default = ["worker", "console", "url", "crypto"]
default = ["worker", "console", "url", "crypto", "snapshot_builder"]
no_extensions = []
all = ["web", "io"]

Expand All @@ -27,8 +27,8 @@ web = ["console", "url", "crypto", "deno_web", "deno_fetch", "url_import", "fs_i
fs_import = []
url_import = ["reqwest"]

# Enables the use of the `snapshot` function
snapshot_creation = []
# Enables the use of the SnapshotBuilder
snapshot_builder = []

# Enables the threaded worker API
worker = []
Expand All @@ -39,7 +39,7 @@ criterion = "0.5.1"

[dependencies]
deno_core = "0.288.0"
deno_ast = { version = "0.39.1", features = ["transpiling"]}
deno_ast = { version = "0.39.2", features = ["transpiling"]}
thiserror = "1.0.61"
serde = "1.0.203"
tokio = "1.38.0"
Expand All @@ -59,11 +59,14 @@ deno_net = {version = "0.148.0", optional = true}
# io feature deps
deno_io = {version = "0.66.0", optional = true}
rustyline = {version = "=14.0.0", optional = true}
winapi = {version = "=0.3.9", optional = true}
nix = {version = "=0.28.0", optional = true}
winapi = {version = "=0.3.9", optional = true, features = ["commapi", "knownfolders", "mswsock", "objbase", "psapi", "shlobj", "tlhelp32", "winbase", "winerror", "winuser", "winsock2", "processenv", "wincon", "wincontypes"]}
nix = {version = "=0.29.0", optional = true}
libc = {version = "0.2.155", optional = true}
once_cell = {version = "1.19.0", optional = true}

[patch.crates-io]
deno_permissions = { path = "../../temp_workspace/deno/runtime/permissions" }

[[example]]
name = "custom_threaded_worker"
required-features = ["worker"]
Expand Down
4 changes: 2 additions & 2 deletions benches/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("call_function", |b| {
b.iter(|| {
let _: usize = runtime
.call_function(&modref, "test", json_args!())
.call_function(Some(&modref), "test", json_args!())
.expect("could not call function");
})
});

c.bench_function("call_function_with_args", |b| {
b.iter(|| {
let _: usize = runtime
.call_function(&modref, "test", json_args!("test", 1, false))
.call_function(Some(&modref), "test", json_args!("test", 1, false))
.expect("could not call function");
})
});
Expand Down
Loading

0 comments on commit bd6614e

Please sign in to comment.