-
-
Notifications
You must be signed in to change notification settings - Fork 49
refactor: inline CallbackBuilder<P>
into IntoScriptPluginParams
at compile time
#456
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 1 commit into
main
from
refactor/make-callback-builder-into-compile-time-concept
Aug 19, 2025
Merged
refactor: inline CallbackBuilder<P>
into IntoScriptPluginParams
at compile time
#456
makspll
merged 1 commit into
main
from
refactor/make-callback-builder-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
|
CallbackSettings
into IntoScriptPluginParams
at compile timeCallbackBuilder<P>
into IntoScriptPluginParams
at compile time
|
Branch | refactor/make-callback-builder-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,409.80 ns(-26.90%)Baseline: 4,664.36 ns | 6,159.75 ns (55.36%) |
component/access Rhai | 📈 view plot 🚷 view threshold | 5,346.00 ns(-18.77%)Baseline: 6,581.05 ns | 7,875.29 ns (67.88%) |
component/get Lua | 📈 view plot 🚷 view threshold | 2,112.80 ns(-23.47%)Baseline: 2,760.73 ns | 3,486.91 ns (60.59%) |
component/get Rhai | 📈 view plot 🚷 view threshold | 4,121.00 ns(-14.95%)Baseline: 4,845.35 ns | 5,852.26 ns (70.42%) |
conversions/Mut::from | 📈 view plot 🚷 view threshold | 81.84 ns(-31.46%)Baseline: 119.41 ns | 220.41 ns (37.13%) |
conversions/Ref::from | 📈 view plot 🚷 view threshold | 82.64 ns(-29.67%)Baseline: 117.50 ns | 217.92 ns (37.92%) |
conversions/ScriptValue::List | 📈 view plot 🚷 view threshold | 262.95 ns(-47.60%)Baseline: 501.85 ns | 1,043.30 ns (25.20%) |
conversions/ScriptValue::Map | 📈 view plot 🚷 view threshold | 1,223.40 ns(-20.59%)Baseline: 1,540.69 ns | 2,112.03 ns (57.93%) |
conversions/ScriptValue::Reference::from_into | 📈 view plot 🚷 view threshold | 24.85 ns(-33.18%)Baseline: 37.19 ns | 61.81 ns (40.20%) |
conversions/Val::from_into | 📈 view plot 🚷 view threshold | 240.23 ns(-27.31%)Baseline: 330.49 ns | 440.10 ns (54.59%) |
function/call 4 args Lua | 📈 view plot 🚷 view threshold | 1,611.40 ns(-20.64%)Baseline: 2,030.44 ns | 2,448.64 ns (65.81%) |
function/call 4 args Rhai | 📈 view plot 🚷 view threshold | 1,379.10 ns(-20.42%)Baseline: 1,733.04 ns | 2,178.31 ns (63.31%) |
function/call Lua | 📈 view plot 🚷 view threshold | 231.75 ns(-14.22%)Baseline: 270.18 ns | 328.47 ns (70.56%) |
function/call Rhai | 📈 view plot 🚷 view threshold | 429.25 ns(-16.04%)Baseline: 511.28 ns | 653.60 ns (65.67%) |
loading/empty Lua | 📈 view plot 🚷 view threshold | 51,202.00 ns(-39.62%)Baseline: 84,795.44 ns | 132,662.65 ns (38.60%) |
loading/empty Rhai | 📈 view plot 🚷 view threshold | 367,400.00 ns(-59.83%)Baseline: 914,660.00 ns | 2,145,985.09 ns (17.12%) |
math/vec mat ops Lua | 📈 view plot 🚷 view threshold | 6,684.30 ns(-13.52%)Baseline: 7,729.17 ns | 8,972.41 ns (74.50%) |
math/vec mat ops Rhai | 📈 view plot 🚷 view threshold | 5,808.80 ns(-20.40%)Baseline: 7,297.86 ns | 8,426.65 ns (68.93%) |
query/10 entities Lua | 📈 view plot 🚷 view threshold | 19,268.00 ns(-18.86%)Baseline: 23,745.34 ns | 29,657.85 ns (64.97%) |
query/10 entities Rhai | 📈 view plot 🚷 view threshold | 18,694.00 ns(-21.24%)Baseline: 23,736.26 ns | 28,196.55 ns (66.30%) |
query/100 entities Lua | 📈 view plot 🚷 view threshold | 37,542.00 ns(-22.12%)Baseline: 48,201.92 ns | 59,486.00 ns (63.11%) |
query/100 entities Rhai | 📈 view plot 🚷 view threshold | 29,592.00 ns(-21.83%)Baseline: 37,854.12 ns | 46,645.81 ns (63.44%) |
query/1000 entities Lua | 📈 view plot 🚷 view threshold | 234,090.00 ns(-24.31%)Baseline: 309,255.20 ns | 374,614.30 ns (62.49%) |
query/1000 entities Rhai | 📈 view plot 🚷 view threshold | 186,010.00 ns(-11.12%)Baseline: 209,292.60 ns | 284,930.32 ns (65.28%) |
reflection/10 Lua | 📈 view plot 🚷 view threshold | 5,502.40 ns(-14.73%)Baseline: 6,452.70 ns | 7,378.28 ns (74.58%) |
reflection/10 Rhai | 📈 view plot 🚷 view threshold | 14,877.00 ns(-9.03%)Baseline: 16,353.32 ns | 17,887.11 ns (83.17%) |
reflection/100 Lua | 📈 view plot 🚷 view threshold | 48,020.00 ns(-9.79%)Baseline: 53,233.44 ns | 59,107.11 ns (81.24%) |
reflection/100 Rhai | 📈 view plot 🚷 view threshold | 653,760.00 ns(-12.54%)Baseline: 747,456.80 ns | 873,607.36 ns (74.83%) |
resource/access Lua | 📈 view plot 🚷 view threshold | 3,108.00 ns(-24.80%)Baseline: 4,133.11 ns | 5,344.11 ns (58.16%) |
resource/access Rhai | 📈 view plot 🚷 view threshold | 4,884.00 ns(-16.91%)Baseline: 5,878.09 ns | 7,210.79 ns (67.73%) |
resource/get Lua | 📈 view plot 🚷 view threshold | 1,768.40 ns(-23.33%)Baseline: 2,306.58 ns | 2,921.25 ns (60.54%) |
resource/get Rhai | 📈 view plot 🚷 view threshold | 3,697.80 ns(-12.06%)Baseline: 4,205.02 ns | 5,154.71 ns (71.74%) |
3a77b3f
to
05a7e71
Compare
Merged
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
Follow up to #455, which does the exact same refactoring for the other, context lifecycle related functions. These do not expect to be modified at compile time.
Migration Guide
Replace all usages of
CallbackBuilder<P>.load
andCallbackBuilder<P>.reload
withP::load(..)
andP::reload(..)
orP::context_loader()(..)
andP::context_reloader()(..)