Skip to content

Conversation

makspll
Copy link
Owner

@makspll makspll commented Aug 30, 2025

Summary

All of ContextLoadFn ContextReloadFn and HandlerFn now accept WorldId instead of directly requiring the properties available within the static config introduced in #470 . This simplifies signatures, removes the need to retrieve the runtime if you don't need one, and is all around more ergonomic

Migration Guide

if you implemented a scripting plugin you will need to correct your function signatures for the above aliases, and fetch the config yourself to access callbacks via Plugin::readonly_configuration(world_id) using the world id you will now receive.

Copy link

semanticdiff-com bot commented Aug 30, 2025

@makspll makspll changed the title refactor: reduce property passing, pass around WorldId instead refactor: reduce property passing, pass around WorldId instead Aug 30, 2025
@makspll makspll enabled auto-merge (squash) August 30, 2025 09:26
@makspll makspll disabled auto-merge August 30, 2025 09:26
@makspll makspll changed the title refactor: reduce property passing, pass around WorldId instead refactor: modify ContextLoadFn & ContextReloadFn & HandlerFn to use WorldId instead of direct config Aug 30, 2025
@makspll makspll enabled auto-merge (squash) August 30, 2025 09:27
@makspll makspll disabled auto-merge August 30, 2025 09:53
@makspll makspll merged commit 419e31a into main Aug 30, 2025
21 of 28 checks passed
@makspll makspll deleted the refactor/reduce-property-passing branch August 30, 2025 09:53
Copy link
Contributor

github-actions bot commented Aug 30, 2025

🐰 Bencher Report

Branchrefactor/reduce-property-passing
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,484.10 ns
(-12.72%)Baseline: 3,992.06 ns
4,494.03 ns
(77.53%)
component/access Rhai📈 view plot
🚷 view threshold
5,514.20 ns
(-5.93%)Baseline: 5,861.52 ns
6,320.57 ns
(87.24%)
component/get Lua📈 view plot
🚷 view threshold
2,203.00 ns
(-8.61%)Baseline: 2,410.53 ns
2,698.86 ns
(81.63%)
component/get Rhai📈 view plot
🚷 view threshold
4,336.10 ns
(-1.01%)Baseline: 4,380.45 ns
4,680.82 ns
(92.64%)
conversions/Mut::from📈 view plot
🚷 view threshold
81.78 ns
(-5.09%)Baseline: 86.17 ns
92.22 ns
(88.68%)
conversions/Ref::from📈 view plot
🚷 view threshold
76.93 ns
(-7.94%)Baseline: 83.57 ns
90.07 ns
(85.41%)
conversions/ScriptValue::List📈 view plot
🚷 view threshold
299.50 ns
(+5.81%)Baseline: 283.05 ns
325.61 ns
(91.98%)
conversions/ScriptValue::Map📈 view plot
🚷 view threshold
913.53 ns
(-23.70%)Baseline: 1,197.22 ns
1,665.65 ns
(54.85%)
conversions/ScriptValue::Reference::from_into📈 view plot
🚷 view threshold
26.41 ns
(+9.41%)Baseline: 24.14 ns
27.18 ns
(97.16%)
conversions/Val::from_into📈 view plot
🚷 view threshold
297.73 ns
(-1.83%)Baseline: 303.27 ns
360.98 ns
(82.48%)
function/call 4 args Lua📈 view plot
🚷 view threshold
1,537.30 ns
(-17.41%)Baseline: 1,861.35 ns
2,200.61 ns
(69.86%)
function/call 4 args Rhai📈 view plot
🚷 view threshold
1,270.90 ns
(-16.89%)Baseline: 1,529.10 ns
1,822.75 ns
(69.72%)
function/call Lua📈 view plot
🚷 view threshold
227.81 ns
(-5.50%)Baseline: 241.06 ns
264.83 ns
(86.02%)
function/call Rhai📈 view plot
🚷 view threshold
393.05 ns
(-14.29%)Baseline: 458.59 ns
533.35 ns
(73.69%)
loading/empty Lua📈 view plot
🚷 view threshold
53,543.00 ns
(-16.55%)Baseline: 64,159.80 ns
74,523.00 ns
(71.85%)
loading/empty Rhai📈 view plot
🚷 view threshold
310,320.00 ns
(-17.17%)Baseline: 374,657.00 ns
462,710.56 ns
(67.07%)
math/vec mat ops Lua📈 view plot
🚷 view threshold
7,300.20 ns
(-4.22%)Baseline: 7,622.17 ns
8,750.72 ns
(83.42%)
math/vec mat ops Rhai📈 view plot
🚷 view threshold
6,270.50 ns
(-7.37%)Baseline: 6,769.50 ns
7,564.23 ns
(82.90%)
query/10 entities Lua📈 view plot
🚷 view threshold
18,519.00 ns
(-11.49%)Baseline: 20,922.50 ns
23,776.22 ns
(77.89%)
query/10 entities Rhai📈 view plot
🚷 view threshold
18,864.00 ns
(-9.76%)Baseline: 20,903.70 ns
23,860.23 ns
(79.06%)
query/100 entities Lua📈 view plot
🚷 view threshold
40,276.00 ns
(-6.03%)Baseline: 42,860.50 ns
45,937.96 ns
(87.67%)
query/100 entities Rhai📈 view plot
🚷 view threshold
32,828.00 ns
(-1.47%)Baseline: 33,317.70 ns
35,930.72 ns
(91.36%)
query/1000 entities Lua📈 view plot
🚷 view threshold
270,180.00 ns
(-4.13%)Baseline: 281,815.00 ns
310,754.15 ns
(86.94%)
query/1000 entities Rhai📈 view plot
🚷 view threshold
176,060.00 ns
(+1.99%)Baseline: 172,627.00 ns
189,752.51 ns
(92.78%)
reflection/10 Lua📈 view plot
🚷 view threshold
5,713.00 ns
(-7.92%)Baseline: 6,204.40 ns
6,787.75 ns
(84.17%)
reflection/10 Rhai📈 view plot
🚷 view threshold
15,603.00 ns
(-2.86%)Baseline: 16,061.80 ns
17,094.14 ns
(91.28%)
reflection/100 Lua📈 view plot
🚷 view threshold
48,727.00 ns
(-5.70%)Baseline: 51,670.20 ns
57,099.19 ns
(85.34%)
reflection/100 Rhai📈 view plot
🚷 view threshold
720,500.00 ns
(-4.85%)Baseline: 757,193.00 ns
834,250.74 ns
(86.36%)
resource/access Lua📈 view plot
🚷 view threshold
3,123.80 ns
(-13.28%)Baseline: 3,602.29 ns
4,126.83 ns
(75.69%)
resource/access Rhai📈 view plot
🚷 view threshold
5,022.30 ns
(-6.11%)Baseline: 5,349.24 ns
5,843.18 ns
(85.95%)
resource/get Lua📈 view plot
🚷 view threshold
1,832.50 ns
(-11.35%)Baseline: 2,067.08 ns
2,357.69 ns
(77.72%)
resource/get Rhai📈 view plot
🚷 view threshold
3,830.20 ns
(-2.11%)Baseline: 3,912.75 ns
4,303.20 ns
(89.01%)
🐰 View full continuous benchmarking report in Bencher

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