feat: v8 profiling
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ profile.json.gz
|
|||||||
prof.json
|
prof.json
|
||||||
*.cpuprofile
|
*.cpuprofile
|
||||||
*.cpuprofile.gz
|
*.cpuprofile.gz
|
||||||
|
*v8.log
|
||||||
|
|||||||
8
Justfile
8
Justfile
@@ -21,3 +21,11 @@
|
|||||||
[no-exit-message]
|
[no-exit-message]
|
||||||
@evali expr:
|
@evali expr:
|
||||||
cargo run --release --features inspector -- --inspect-brk 127.0.0.1:9229 eval --expr '{{expr}}'
|
cargo run --release --features inspector -- --inspect-brk 127.0.0.1:9229 eval --expr '{{expr}}'
|
||||||
|
|
||||||
|
[no-exit-message]
|
||||||
|
@replp:
|
||||||
|
cargo run --release --features prof -- repl
|
||||||
|
|
||||||
|
[no-exit-message]
|
||||||
|
@evalp expr:
|
||||||
|
cargo run --release --features prof -- eval --expr '{{expr}}'
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ uuid = { version = "1", features = ["v4"], optional = true }
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
inspector = ["dep:fastwebsockets", "dep:hyper", "dep:hyper-util", "dep:http-body-util", "dep:http", "dep:uuid"]
|
inspector = ["dep:fastwebsockets", "dep:hyper", "dep:hyper-util", "dep:http-body-util", "dep:http", "dep:uuid"]
|
||||||
|
prof = []
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = { version = "0.8", features = ["html_reports"] }
|
criterion = { version = "0.8", features = ["html_reports"] }
|
||||||
|
|||||||
@@ -142,7 +142,12 @@ impl<Ctx: RuntimeContext> Runtime<Ctx> {
|
|||||||
static INIT: Once = Once::new();
|
static INIT: Once = Once::new();
|
||||||
INIT.call_once(|| {
|
INIT.call_once(|| {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
deno_core::v8_set_flags(vec!["".into(), format!("--stack-size={}", 8 * 1024)]),
|
deno_core::v8_set_flags(vec![
|
||||||
|
"".into(),
|
||||||
|
format!("--stack-size={}", 8 * 1024),
|
||||||
|
#[cfg(feature = "prof")]
|
||||||
|
("--prof".into())
|
||||||
|
]),
|
||||||
[""]
|
[""]
|
||||||
);
|
);
|
||||||
JsRuntime::init_platform(Some(v8::new_default_platform(0, false).make_shared()));
|
JsRuntime::init_platform(Some(v8::new_default_platform(0, false).make_shared()));
|
||||||
|
|||||||
Reference in New Issue
Block a user