With every connection on its own thread (previous commit), the process-wide V8 lock served no safety purpose across connections yet forced all of them to serialize on one mutex, so throughput did not scale with concurrency. Move the lock into CdpContext so each connection has its own: a connection's nav task and command dispatch still coordinate on one page's isolate at a time on its thread, but different connections no longer block each other. Delete the now-unused process-wide obscura_js::v8_lock. Measured on a local CPU-bound fixture, page throughput stays flat (~75/s from concurrency 1 to 8) with the global lock and scales to about 2.5x at concurrency 8 with the per-connection lock, with no crash at any concurrency. Obstacle course 33/33, obscura-cdp 76/76. Refs #430.
13 lines
221 B
Rust
13 lines
221 B
Rust
#[macro_use]
|
|
extern crate html5ever;
|
|
|
|
pub mod cdp_watchdog;
|
|
pub mod module_loader;
|
|
pub mod runtime;
|
|
pub mod ops;
|
|
pub mod v8_flags;
|
|
pub mod markdown;
|
|
|
|
pub use markdown::HTML_TO_MARKDOWN_JS;
|
|
pub use v8_flags::set_v8_flags;
|