Skip to content

Conversation

makspll
Copy link
Owner

@makspll makspll commented Aug 30, 2025

Summary

Does what #470 did with context loading settings but for the runtime.

Since it's this is something we initialize once and then purely read (or modify through read refs), it can fit this model.

This leaves only 2 resources in the handler context

Migration Guide

RuntimeSettings and RuntimeContainer are removed, replace usages with P::readonly_settings(world.id()).runtime) access to initializers is no longer possible outside the plugin setup phase

Copy link

semanticdiff-com bot commented Aug 30, 2025

@makspll makspll changed the title refactor: remove runtime container, add plugin runtime to static world local settings refactor: remove RuntimeContainer & RuntimeSettings, add plugin runtime to static world local settings Aug 30, 2025
@makspll makspll enabled auto-merge (squash) August 30, 2025 00:52
Copy link
Contributor

github-actions bot commented Aug 30, 2025

🐰 Bencher Report

Branchrefactor/remove-runtime-container
Testbedlinux-gha
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
component/access Lua📈 view plot
🚷 view threshold
3,637.20 ns
(-9.84%)Baseline: 4,033.94 ns
4,455.27 ns
(81.64%)
component/access Rhai📈 view plot
🚷 view threshold
5,504.70 ns
(-6.06%)Baseline: 5,860.03 ns
6,323.00 ns
(87.06%)
component/get Lua📈 view plot
🚷 view threshold
2,181.60 ns
(-10.10%)Baseline: 2,426.74 ns
2,734.67 ns
(79.78%)
component/get Rhai📈 view plot
🚷 view threshold
4,301.30 ns
(-1.63%)Baseline: 4,372.47 ns
4,663.57 ns
(92.23%)
conversions/Mut::from📈 view plot
🚷 view threshold
81.70 ns
(-5.04%)Baseline: 86.03 ns
92.20 ns
(88.61%)
conversions/Ref::from📈 view plot
🚷 view threshold
78.46 ns
(-6.05%)Baseline: 83.51 ns
89.20 ns
(87.96%)
conversions/ScriptValue::List📈 view plot
🚷 view threshold
278.29 ns
(-0.80%)Baseline: 280.55 ns
319.31 ns
(87.15%)
conversions/ScriptValue::Map📈 view plot
🚷 view threshold
1,159.80 ns
(-7.46%)Baseline: 1,253.25 ns
1,604.06 ns
(72.30%)
conversions/ScriptValue::Reference::from_into📈 view plot
🚷 view threshold
26.59 ns
(+10.37%)Baseline: 24.09 ns
27.33 ns
(97.31%)
conversions/Val::from_into📈 view plot
🚷 view threshold
303.66 ns
(-1.09%)Baseline: 307.02 ns
360.26 ns
(84.29%)
function/call 4 args Lua📈 view plot
🚷 view threshold
1,634.70 ns
(-13.23%)Baseline: 1,884.00 ns
2,165.88 ns
(75.48%)
function/call 4 args Rhai📈 view plot
🚷 view threshold
1,340.60 ns
(-13.28%)Baseline: 1,545.87 ns
1,815.79 ns
(73.83%)
function/call Lua📈 view plot
🚷 view threshold
225.00 ns
(-7.25%)Baseline: 242.57 ns
265.59 ns
(84.72%)
function/call Rhai📈 view plot
🚷 view threshold
423.75 ns
(-9.63%)Baseline: 468.92 ns
549.08 ns
(77.17%)
loading/empty Lua📈 view plot
🚷 view threshold
53,585.00 ns
(-16.45%)Baseline: 64,138.20 ns
74,434.59 ns
(71.99%)
loading/empty Rhai📈 view plot
🚷 view threshold
302,530.00 ns
(-18.94%)Baseline: 373,226.00 ns
464,484.92 ns
(65.13%)
math/vec mat ops Lua📈 view plot
🚷 view threshold
7,058.80 ns
(-7.33%)Baseline: 7,616.92 ns
8,816.70 ns
(80.06%)
math/vec mat ops Rhai📈 view plot
🚷 view threshold
6,110.10 ns
(-10.49%)Baseline: 6,825.99 ns
7,702.88 ns
(79.32%)
query/10 entities Lua📈 view plot
🚷 view threshold
18,950.00 ns
(-10.57%)Baseline: 21,189.50 ns
24,024.18 ns
(78.88%)
query/10 entities Rhai📈 view plot
🚷 view threshold
18,936.00 ns
(-10.07%)Baseline: 21,056.70 ns
24,179.36 ns
(78.31%)
query/100 entities Lua📈 view plot
🚷 view threshold
39,726.00 ns
(-7.81%)Baseline: 43,091.10 ns
46,789.97 ns
(84.90%)
query/100 entities Rhai📈 view plot
🚷 view threshold
32,747.00 ns
(-1.94%)Baseline: 33,393.60 ns
36,265.82 ns
(90.30%)
query/1000 entities Lua📈 view plot
🚷 view threshold
263,930.00 ns
(-6.47%)Baseline: 282,191.00 ns
313,276.80 ns
(84.25%)
query/1000 entities Rhai📈 view plot
🚷 view threshold
168,350.00 ns
(-3.00%)Baseline: 173,560.00 ns
192,011.23 ns
(87.68%)
reflection/10 Lua📈 view plot
🚷 view threshold
5,752.00 ns
(-7.45%)Baseline: 6,215.16 ns
6,780.84 ns
(84.83%)
reflection/10 Rhai📈 view plot
🚷 view threshold
15,249.00 ns
(-5.62%)Baseline: 16,156.20 ns
17,697.78 ns
(86.16%)
reflection/100 Lua📈 view plot
🚷 view threshold
48,414.00 ns
(-6.34%)Baseline: 51,692.30 ns
57,292.57 ns
(84.50%)
reflection/100 Rhai📈 view plot
🚷 view threshold
732,960.00 ns
(-3.81%)Baseline: 761,960.00 ns
843,871.69 ns
(86.86%)
resource/access Lua📈 view plot
🚷 view threshold
3,268.00 ns
(-10.35%)Baseline: 3,645.09 ns
4,084.79 ns
(80.00%)
resource/access Rhai📈 view plot
🚷 view threshold
5,040.40 ns
(-5.64%)Baseline: 5,341.79 ns
5,811.04 ns
(86.74%)
resource/get Lua📈 view plot
🚷 view threshold
1,850.60 ns
(-11.00%)Baseline: 2,079.40 ns
2,354.24 ns
(78.61%)
resource/get Rhai📈 view plot
🚷 view threshold
3,837.40 ns
(-1.64%)Baseline: 3,901.47 ns
4,271.93 ns
(89.83%)
🐰 View full continuous benchmarking report in Bencher

@makspll makspll merged commit 548e2c5 into main Aug 30, 2025
23 of 24 checks passed
@makspll makspll deleted the refactor/remove-runtime-container branch August 30, 2025 01:40
@github-actions github-actions bot mentioned this pull request Aug 30, 2025
@github-actions github-actions bot mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant