-
-
Notifications
You must be signed in to change notification settings - Fork 47
refactor: inline CallbackSettings<P>
into IntoScriptPluginParam
at compile time
#455
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
makspll
merged 3 commits into
main
from
refactor/make-callback-settings-into-compile-time-concept
Aug 19, 2025
Merged
refactor: inline CallbackSettings<P>
into IntoScriptPluginParam
at compile time
#455
makspll
merged 3 commits into
main
from
refactor/make-callback-settings-into-compile-time-concept
Aug 19, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changed Files
|
|
Branch | refactor/make-callback-settings-into-compile-time-concept |
Testbed | linux-gha |
Click to view all benchmark results
Benchmark | Latency | Benchmark Result nanoseconds (ns) (Result Δ%) | Upper Boundary nanoseconds (ns) (Limit %) |
---|---|---|---|
component/access Lua | 📈 view plot 🚷 view threshold | 3,607.30 ns(-22.91%)Baseline: 4,679.63 ns | 6,160.05 ns (58.56%) |
component/access Rhai | 📈 view plot 🚷 view threshold | 5,341.50 ns(-19.00%)Baseline: 6,594.26 ns | 7,882.00 ns (67.77%) |
component/get Lua | 📈 view plot 🚷 view threshold | 2,200.70 ns(-20.48%)Baseline: 2,767.54 ns | 3,487.59 ns (63.10%) |
component/get Rhai | 📈 view plot 🚷 view threshold | 4,123.30 ns(-15.00%)Baseline: 4,850.92 ns | 5,863.61 ns (70.32%) |
conversions/Mut::from | 📈 view plot 🚷 view threshold | 83.20 ns(-30.82%)Baseline: 120.26 ns | 221.70 ns (37.53%) |
conversions/Ref::from | 📈 view plot 🚷 view threshold | 77.88 ns(-34.12%)Baseline: 118.22 ns | 219.37 ns (35.50%) |
conversions/ScriptValue::List | 📈 view plot 🚷 view threshold | 265.97 ns(-47.59%)Baseline: 507.52 ns | 1,048.81 ns (25.36%) |
conversions/ScriptValue::Map | 📈 view plot 🚷 view threshold | 1,359.00 ns(-12.34%)Baseline: 1,550.31 ns | 2,111.78 ns (64.35%) |
conversions/ScriptValue::Reference::from_into | 📈 view plot 🚷 view threshold | 26.23 ns(-30.11%)Baseline: 37.54 ns | 61.90 ns (42.38%) |
conversions/Val::from_into | 📈 view plot 🚷 view threshold | 299.89 ns(-9.67%)Baseline: 332.00 ns | 438.24 ns (68.43%) |
function/call 4 args Lua | 📈 view plot 🚷 view threshold | 1,596.80 ns(-21.51%)Baseline: 2,034.39 ns | 2,452.69 ns (65.10%) |
function/call 4 args Rhai | 📈 view plot 🚷 view threshold | 1,312.90 ns(-24.28%)Baseline: 1,733.82 ns | 2,189.19 ns (59.97%) |
function/call Lua | 📈 view plot 🚷 view threshold | 234.27 ns(-13.51%)Baseline: 270.87 ns | 328.58 ns (71.30%) |
function/call Rhai | 📈 view plot 🚷 view threshold | 395.39 ns(-22.70%)Baseline: 511.52 ns | 657.27 ns (60.16%) |
loading/empty Lua | 📈 view plot 🚷 view threshold | 52,062.00 ns(-39.59%)Baseline: 86,179.40 ns | 133,764.28 ns (38.92%) |
loading/empty Rhai | 📈 view plot 🚷 view threshold | 289,810.00 ns(-69.32%)Baseline: 944,469.33 ns | 2,191,032.09 ns (13.23%) |
math/vec mat ops Lua | 📈 view plot 🚷 view threshold | 6,764.20 ns(-12.66%)Baseline: 7,744.68 ns | 8,971.21 ns (75.40%) |
math/vec mat ops Rhai | 📈 view plot 🚷 view threshold | 5,921.30 ns(-19.00%)Baseline: 7,310.40 ns | 8,420.89 ns (70.32%) |
query/10 entities Lua | 📈 view plot 🚷 view threshold | 18,627.00 ns(-21.65%)Baseline: 23,773.80 ns | 29,769.96 ns (62.57%) |
query/10 entities Rhai | 📈 view plot 🚷 view threshold | 19,124.00 ns(-19.57%)Baseline: 23,777.24 ns | 28,196.97 ns (67.82%) |
query/100 entities Lua | 📈 view plot 🚷 view threshold | 39,384.00 ns(-18.50%)Baseline: 48,325.55 ns | 59,446.78 ns (66.25%) |
query/100 entities Rhai | 📈 view plot 🚷 view threshold | 29,245.00 ns(-22.90%)Baseline: 37,931.16 ns | 46,742.02 ns (62.57%) |
query/1000 entities Lua | 📈 view plot 🚷 view threshold | 238,910.00 ns(-22.90%)Baseline: 309,881.84 ns | 374,695.02 ns (63.76%) |
query/1000 entities Rhai | 📈 view plot 🚷 view threshold | 156,980.00 ns(-25.03%)Baseline: 209,378.78 ns | 286,674.80 ns (54.76%) |
reflection/10 Lua | 📈 view plot 🚷 view threshold | 5,525.60 ns(-14.39%)Baseline: 6,454.25 ns | 7,386.94 ns (74.80%) |
reflection/10 Rhai | 📈 view plot 🚷 view threshold | 15,008.00 ns(-8.22%)Baseline: 16,352.06 ns | 17,886.93 ns (83.90%) |
reflection/100 Lua | 📈 view plot 🚷 view threshold | 48,076.00 ns(-9.70%)Baseline: 53,241.94 ns | 59,172.30 ns (81.25%) |
reflection/100 Rhai | 📈 view plot 🚷 view threshold | 699,840.00 ns(-6.48%)Baseline: 748,293.27 ns | 872,731.12 ns (80.19%) |
resource/access Lua | 📈 view plot 🚷 view threshold | 3,124.70 ns(-24.56%)Baseline: 4,142.00 ns | 5,355.39 ns (58.35%) |
resource/access Rhai | 📈 view plot 🚷 view threshold | 4,837.50 ns(-17.77%)Baseline: 5,882.86 ns | 7,230.25 ns (66.91%) |
resource/get Lua | 📈 view plot 🚷 view threshold | 1,806.70 ns(-21.79%)Baseline: 2,310.02 ns | 2,925.78 ns (61.75%) |
resource/get Rhai | 📈 view plot 🚷 view threshold | 3,638.30 ns(-13.45%)Baseline: 4,203.69 ns | 5,167.32 ns (70.41%) |
CallbackSettings
into IntoScriptPluginParam
at compile timeCallbackSettings<P>
into IntoScriptPluginParam
at compile time
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Step towards simplifying the handler resources necessary in
bms_core
. Step one is to reduce the number of resources in here. the handler function does not need to be runtime editable, so inlining it into the trait makes senseMigration Guide
Replace all usages of
CallbackSettings<P>.callback_handler
withP::handler()(..)
andP::handle(..)