-
-
Notifications
You must be signed in to change notification settings - Fork 49
refactor: modify ContextLoadFn
& ContextReloadFn
& HandlerFn
to use WorldId
instead of direct config
#472
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
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
|
WorldId
instead
WorldId
insteadContextLoadFn
& ContextReloadFn
& HandlerFn
to use WorldId
instead of direct config
|
Branch | refactor/reduce-property-passing |
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,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%) |
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
All of
ContextLoadFn
ContextReloadFn
andHandlerFn
now acceptWorldId
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 ergonomicMigration 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.