Skip to content

refactor: refactor ReflectReference internally #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

makspll
Copy link
Owner

@makspll makspll commented Apr 2, 2025

Summary

Cleans the code up a bit, moves reflect base constructors into that type, and guarantees that typeid always corresponds to a valid reflect type

@makspll makspll changed the title refactor: reflect reference internally refactor: refactor ReflectReference internally Apr 2, 2025
Copy link
Contributor

github-actions bot commented Apr 2, 2025

🐰 Bencher Report

Branchrefactor/reflect-reference
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,440.30 ns
(-30.72%)Baseline: 4,965.58 ns
6,425.01 ns
(53.55%)
component/access Rhai📈 view plot
🚷 view threshold
5,935.90 ns
(-12.38%)Baseline: 6,774.69 ns
8,063.57 ns
(73.61%)
component/get Lua📈 view plot
🚷 view threshold
2,089.30 ns
(-28.35%)Baseline: 2,916.14 ns
3,590.78 ns
(58.19%)
component/get Rhai📈 view plot
🚷 view threshold
4,703.80 ns
(-4.67%)Baseline: 4,934.22 ns
6,024.02 ns
(78.08%)
conversions/Mut::from📈 view plot
🚷 view threshold
80.09 ns
(-42.72%)Baseline: 139.82 ns
255.02 ns
(31.41%)
conversions/Ref::from📈 view plot
🚷 view threshold
77.90 ns
(-43.49%)Baseline: 137.84 ns
252.99 ns
(30.79%)
conversions/ScriptValue::List📈 view plot
🚷 view threshold
283.07 ns
(-57.94%)Baseline: 673.09 ns
1,077.92 ns
(26.26%)
conversions/ScriptValue::Map📈 view plot
🚷 view threshold
1,186.80 ns
(-29.87%)Baseline: 1,692.30 ns
2,246.30 ns
(52.83%)
conversions/ScriptValue::Reference::from_into📈 view plot
🚷 view threshold
25.45 ns
(-39.44%)Baseline: 42.02 ns
58.30 ns
(43.65%)
conversions/Val::from_into📈 view plot
🚷 view threshold
288.87 ns
(-15.07%)Baseline: 340.14 ns
459.59 ns
(62.85%)
function/call 4 args Lua📈 view plot
🚷 view threshold
1,611.80 ns
(-23.80%)Baseline: 2,115.16 ns
2,533.64 ns
(63.62%)
function/call 4 args Rhai📈 view plot
🚷 view threshold
1,425.30 ns
(-22.53%)Baseline: 1,839.86 ns
2,213.48 ns
(64.39%)
function/call Lua📈 view plot
🚷 view threshold
232.73 ns
(-17.59%)Baseline: 282.39 ns
338.17 ns
(68.82%)
function/call Rhai📈 view plot
🚷 view threshold
438.88 ns
(-18.15%)Baseline: 536.20 ns
667.29 ns
(65.77%)
math/vec mat ops Lua📈 view plot
🚷 view threshold
6,324.00 ns
(-19.21%)Baseline: 7,828.17 ns
9,323.78 ns
(67.83%)
math/vec mat ops Rhai📈 view plot
🚷 view threshold
5,920.90 ns
(-20.84%)Baseline: 7,479.55 ns
8,684.88 ns
(68.17%)
query/10 entities Lua📈 view plot
🚷 view threshold
18,807.00 ns
(-24.91%)Baseline: 25,044.61 ns
30,639.20 ns
(61.38%)
query/10 entities Rhai📈 view plot
🚷 view threshold
21,007.00 ns
(-13.81%)Baseline: 24,371.52 ns
28,843.57 ns
(72.83%)
query/100 entities Lua📈 view plot
🚷 view threshold
40,246.00 ns
(-20.30%)Baseline: 50,498.03 ns
61,602.69 ns
(65.33%)
query/100 entities Rhai📈 view plot
🚷 view threshold
31,891.00 ns
(-19.23%)Baseline: 39,483.45 ns
48,257.11 ns
(66.09%)
query/1000 entities Lua📈 view plot
🚷 view threshold
259,260.00 ns
(-17.14%)Baseline: 312,899.35 ns
388,448.17 ns
(66.74%)
query/1000 entities Rhai📈 view plot
🚷 view threshold
165,730.00 ns
(-25.76%)Baseline: 223,230.97 ns
303,556.24 ns
(54.60%)
reflection/10 Lua📈 view plot
🚷 view threshold
5,461.20 ns
(-17.00%)Baseline: 6,579.61 ns
7,638.14 ns
(71.50%)
reflection/10 Rhai📈 view plot
🚷 view threshold
14,792.00 ns
(-10.17%)Baseline: 16,467.23 ns
18,111.72 ns
(81.67%)
reflection/100 Lua📈 view plot
🚷 view threshold
47,176.00 ns
(-11.79%)Baseline: 53,478.58 ns
60,477.69 ns
(78.01%)
reflection/100 Rhai📈 view plot
🚷 view threshold
725,480.00 ns
(-0.83%)Baseline: 731,547.74 ns
859,483.80 ns
(84.41%)
resource/access Lua📈 view plot
🚷 view threshold
3,025.80 ns
(-30.78%)Baseline: 4,371.18 ns
5,577.84 ns
(54.25%)
resource/access Rhai📈 view plot
🚷 view threshold
5,235.70 ns
(-13.63%)Baseline: 6,061.65 ns
7,509.26 ns
(69.72%)
resource/get Lua📈 view plot
🚷 view threshold
1,734.10 ns
(-28.79%)Baseline: 2,435.08 ns
3,027.72 ns
(57.27%)
resource/get Rhai📈 view plot
🚷 view threshold
3,992.70 ns
(-6.90%)Baseline: 4,288.52 ns
5,358.76 ns
(74.51%)
🐰 View full continuous benchmarking report in Bencher

@makspll makspll merged commit 7e2e970 into main Apr 2, 2025
25 checks passed
@makspll makspll deleted the refactor/reflect-reference branch April 2, 2025 17:39
@github-actions github-actions bot mentioned this pull request Apr 2, 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