mini_racer_rs 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/COMPATIBILITY.md +1 -0
- data/Cargo.lock +5 -5
- data/Cargo.toml +1 -1
- data/README.md +2 -2
- data/crates/mini_racer_engine/src/context.rs +1 -0
- data/crates/mini_racer_engine/src/process/code_cache.rs +521 -26
- data/crates/mini_racer_engine/src/process/sources.rs +56 -1
- data/crates/mini_racer_engine/src/runner.rs +90 -14
- data/ext/mini_racer_rs/src/context.rs +49 -13
- data/ext/mini_racer_rs/src/counters.rs +25 -0
- data/ext/mini_racer_rs/src/rb_raw.rs +43 -0
- data/lib/mini_racer_rs/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83f21cde14bd9acd57ee2a35e4536767bbd5c7dd6d4d4fe497c3e95043c9a6fc
|
|
4
|
+
data.tar.gz: f755934e6ee5581273b9b2b77c311890a160e313b06206da81284f746117fef9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c8a1fcacea4a5020de89ad8b7005a3692382c73115618ada1d941543a709afe5564637239ec9965ba5bcaf10083383c1dc87ba43116bfc9c2aff20911f6ab0eb
|
|
7
|
+
data.tar.gz: 6765a38eb4439310ac203693c7ba3e2350955e0bf2ce317d61865d4b2d4140e4fcbf86bd3db0e85c8b30bd6e4bd44c2fb23e0d4816955f5ce9b3e3342984bbb6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.6.0](https://github.com/andymai/mini_racer_rs/compare/v1.5.3...v1.6.0) (2026-10-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add MiniRacerRs.code_cache ([#164](https://github.com/andymai/mini_racer_rs/issues/164)) ([9238e61](https://github.com/andymai/mini_racer_rs/commit/9238e61e4ae9ab4ae16d50c0035ee7bf611ea258))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Performance
|
|
12
|
+
|
|
13
|
+
* **ext:** copy a large eval source without the GVL ([#163](https://github.com/andymai/mini_racer_rs/issues/163)) ([25fa05e](https://github.com/andymai/mini_racer_rs/commit/25fa05e009086eca64641a699fb5190fb876c69c))
|
|
14
|
+
|
|
15
|
+
## [1.5.3](https://github.com/andymai/mini_racer_rs/compare/v1.5.2...v1.5.3) (2026-10-24)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Performance
|
|
19
|
+
|
|
20
|
+
* **engine:** cache a large first sighting that runs as long as it compiles ([#159](https://github.com/andymai/mini_racer_rs/issues/159)) ([47cc0cc](https://github.com/andymai/mini_racer_rs/commit/47cc0ccd76c5d39ec3c9005b848e5846e213d618))
|
|
21
|
+
* **engine:** cache a script again after its builder's next call ([#160](https://github.com/andymai/mini_racer_rs/issues/160)) ([8f632e0](https://github.com/andymai/mini_racer_rs/commit/8f632e065ec3506687d69e8e13f0df56b2e21064))
|
|
22
|
+
* **engine:** cache scripts from 128 KiB and keep 64 caches ([#158](https://github.com/andymai/mini_racer_rs/issues/158)) ([0b77e64](https://github.com/andymai/mini_racer_rs/commit/0b77e640d311db4c22d711a884be5aeadbcc0e0b))
|
|
23
|
+
|
|
3
24
|
## [1.5.2](https://github.com/andymai/mini_racer_rs/compare/v1.5.1...v1.5.2) (2026-10-24)
|
|
4
25
|
|
|
5
26
|
|
data/COMPATIBILITY.md
CHANGED
|
@@ -103,6 +103,7 @@ What mini_racer_rs adds under `MiniRacerRs`. An internal id is not for callers.
|
|
|
103
103
|
| `imethod:MiniRacerRs::Pool#with` | done | n/a |
|
|
104
104
|
| `module:MiniRacerRs` | done | done |
|
|
105
105
|
| `module:MiniRacerRs::ForkHook` | internal | n/a |
|
|
106
|
+
| `smethod:MiniRacerRs.code_cache` | done | n/a |
|
|
106
107
|
| `smethod:MiniRacerRs.counters` | done | n/a |
|
|
107
108
|
| `smethod:MiniRacerRs.heap_limit` | done | n/a |
|
|
108
109
|
| `smethod:MiniRacerRs.heap_limit=` | done | n/a |
|
data/Cargo.lock
CHANGED
|
@@ -593,7 +593,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
|
593
593
|
|
|
594
594
|
[[package]]
|
|
595
595
|
name = "mini_racer_engine"
|
|
596
|
-
version = "1.
|
|
596
|
+
version = "1.6.0"
|
|
597
597
|
dependencies = [
|
|
598
598
|
"deno_core_icudata",
|
|
599
599
|
"libc",
|
|
@@ -606,7 +606,7 @@ dependencies = [
|
|
|
606
606
|
|
|
607
607
|
[[package]]
|
|
608
608
|
name = "mini_racer_rs"
|
|
609
|
-
version = "1.
|
|
609
|
+
version = "1.6.0"
|
|
610
610
|
dependencies = [
|
|
611
611
|
"magnus",
|
|
612
612
|
"mini_racer_engine",
|
|
@@ -617,7 +617,7 @@ dependencies = [
|
|
|
617
617
|
|
|
618
618
|
[[package]]
|
|
619
619
|
name = "mini_racer_sourcemap"
|
|
620
|
-
version = "1.
|
|
620
|
+
version = "1.6.0"
|
|
621
621
|
dependencies = [
|
|
622
622
|
"memchr",
|
|
623
623
|
"serde",
|
|
@@ -627,7 +627,7 @@ dependencies = [
|
|
|
627
627
|
|
|
628
628
|
[[package]]
|
|
629
629
|
name = "mini_racer_sync"
|
|
630
|
-
version = "1.
|
|
630
|
+
version = "1.6.0"
|
|
631
631
|
dependencies = [
|
|
632
632
|
"loom",
|
|
633
633
|
"thiserror",
|
|
@@ -635,7 +635,7 @@ dependencies = [
|
|
|
635
635
|
|
|
636
636
|
[[package]]
|
|
637
637
|
name = "mini_racer_wire"
|
|
638
|
-
version = "1.
|
|
638
|
+
version = "1.6.0"
|
|
639
639
|
dependencies = [
|
|
640
640
|
"criterion",
|
|
641
641
|
"proptest",
|
data/Cargo.toml
CHANGED
|
@@ -15,7 +15,7 @@ license = "MIT"
|
|
|
15
15
|
publish = false
|
|
16
16
|
repository = "https://github.com/andymai/mini_racer_rs"
|
|
17
17
|
rust-version = "1.91"
|
|
18
|
-
version = "1.
|
|
18
|
+
version = "1.6.0"
|
|
19
19
|
|
|
20
20
|
[workspace.dependencies]
|
|
21
21
|
criterion = {version = "0.8", default-features = false, features = ["cargo_bench_support"]}
|
data/README.md
CHANGED
|
@@ -208,7 +208,7 @@ The repository tests the `path:` form of the shim with rtlcss in `test/consumers
|
|
|
208
208
|
|
|
209
209
|
### Forking servers such as Puma
|
|
210
210
|
|
|
211
|
-
Before forking, evaluate each bundle of
|
|
211
|
+
Before forking, evaluate each bundle of 128 KiB or more twice in the master, then dispose those contexts. Use the renderer's exact source text and file name. The second evaluation builds the process-wide V8 code cache, or the first for a bundle of 16 MiB or more whose top-level code runs at least as long as it compiles. Matching evaluations compile from the cache, and forked children inherit it. The context that built a cache rebuilds it once after its next call, so a render in the master also gives children the functions that render compiled. For Babel's 2.3 MB bundle at commit `5e13c1c`, a forked child's first load took 60.8 ms without a parent load. It took 65.5 ms after one load and 25.0 ms after two. These are medians across 5 trials. Prime a `react-rails` app by building its server renderer twice. Children do not use parent contexts. Only the cache carries over.
|
|
212
212
|
|
|
213
213
|
For Ruby's `fork`, `IO.popen("-")`, or `Process.daemon`, mini_racer_rs waits for context runners, pauses its worker pool and waits for running tasks. An async `WebAssembly.compile` in a new default-mode child completes on the child's own pool. On Ubuntu 24.04 with glibc 2.39, 20 of 20 mini_racer 0.22.1 children aborted with signal 6 after React rendering; all mini_racer_rs children exited cleanly. mini_racer 0.22.2 has the same fork handling. On Fedora, `test/stress/fork_busy.rb` aborted with mini_racer 0.22.2 in 3 of 3 runs, after 5, 14 and 19 forks, when an evaluating parent thread raised `TypeError`. mini_racer_rs completed 300 forks per run on Fedora and Ubuntu.
|
|
214
214
|
|
|
@@ -230,7 +230,7 @@ With `mini_racer` 0.22.2, each worker compiles the bundle from source on its fir
|
|
|
230
230
|
|
|
231
231
|
Results are medians of 5 runs. Every workload produced identical output in both gems. The eight library workloads use one run of the Ruby 3.4 extension from the published mini_racer_rs 1.5.1 `x86_64-linux-gnu` gem against mini_racer 0.22.2. The 44 MB production bundle load uses a second run of the same gem against mini_racer 0.22.2. Benchmarks ran on Ruby 3.4.2 and Linux with an AMD Ryzen 9 7950X3D. The governor was `performance`. Both gems were pinned to CPUs 0 through 7.
|
|
232
232
|
|
|
233
|
-
The per-call and memory figures below come from the first run of that extension on the same machine, except the production bundle row, which comes from the second run. One watchdog thread serves the whole process, making a call with `timeout:` fast. Scripts of
|
|
233
|
+
The per-call and memory figures below come from the first run of that extension on the same machine, except the production bundle row, which comes from the second run. One watchdog thread serves the whole process, making a call with `timeout:` fast. Scripts of 128 KiB or more use a process-wide V8 code cache. Contexts loading the same script of 1 MiB or more share one source copy.
|
|
234
234
|
|
|
235
235
|
| Measure | mini_racer 0.22.2 | mini_racer_rs |
|
|
236
236
|
|---|---:|---:|
|
|
@@ -251,6 +251,7 @@ impl ContextHandle {
|
|
|
251
251
|
process::ensure_initialized();
|
|
252
252
|
// Read here, on the caller's thread, not first on a runner's.
|
|
253
253
|
let _ = process::code_cache::enabled();
|
|
254
|
+
let _ = process::code_cache::first_override();
|
|
254
255
|
let _ = process::fast_calls();
|
|
255
256
|
let generation = fork::current();
|
|
256
257
|
let block = Arc::new(ControlBlock::new(config));
|