-
-
Notifications
You must be signed in to change notification settings - Fork 48
feat: improve and formalize script processing pipeline #481
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
Open
makspll
wants to merge
5
commits into
main
Choose a base branch
from
feat/improved-script-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
|
Branch | feat/improved-script-pipeline |
Testbed | linux-gha |
🚨 2 Alerts
Benchmark | Measure Units | View | Benchmark Result (Result Δ%) | Upper Boundary (Limit %) |
---|---|---|---|---|
loading/empty Lua | Latency milliseconds (ms) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 1.34 ms(+596.08%)Baseline: 0.19 ms | 1.27 ms (105.37%) |
loading/empty Rhai | Latency milliseconds (ms) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 1.05 ms(+128.96%)Baseline: 0.46 ms | 1.01 ms (103.10%) |
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,667.70 ns(-8.25%)Baseline: 3,997.39 ns | 4,363.23 ns (84.06%) |
component/access Rhai | 📈 view plot 🚷 view threshold | 5,352.00 ns(-8.98%)Baseline: 5,879.91 ns | 6,443.41 ns (83.06%) |
component/get Lua | 📈 view plot 🚷 view threshold | 2,273.50 ns(-5.47%)Baseline: 2,405.14 ns | 2,611.90 ns (87.04%) |
component/get Rhai | 📈 view plot 🚷 view threshold | 4,098.40 ns(-6.91%)Baseline: 4,402.53 ns | 4,892.52 ns (83.77%) |
conversions/Mut::from | 📈 view plot 🚷 view threshold | 79.40 ns(-7.93%)Baseline: 86.24 ns | 94.48 ns (84.04%) |
conversions/Ref::from | 📈 view plot 🚷 view threshold | 75.60 ns(-10.94%)Baseline: 84.88 ns | 97.21 ns (77.77%) |
conversions/ScriptValue::List | 📈 view plot 🚷 view threshold | 340.69 ns(+10.24%)Baseline: 309.05 ns | 420.21 ns (81.08%) |
conversions/ScriptValue::Map | 📈 view plot 🚷 view threshold | 1,020.60 ns(-6.01%)Baseline: 1,085.86 ns | 1,336.64 ns (76.36%) |
conversions/ScriptValue::Reference::from_into | 📈 view plot 🚷 view threshold | 25.06 ns(-2.52%)Baseline: 25.71 ns | 31.01 ns (80.83%) |
conversions/Val::from_into | 📈 view plot 🚷 view threshold | 267.20 ns(-9.88%)Baseline: 296.48 ns | 348.22 ns (76.73%) |
function/call 4 args Lua | 📈 view plot 🚷 view threshold | 1,563.50 ns(-15.52%)Baseline: 1,850.82 ns | 2,150.58 ns (72.70%) |
function/call 4 args Rhai | 📈 view plot 🚷 view threshold | 1,331.90 ns(-11.63%)Baseline: 1,507.19 ns | 1,710.50 ns (77.87%) |
function/call Lua | 📈 view plot 🚷 view threshold | 226.36 ns(-6.96%)Baseline: 243.28 ns | 272.02 ns (83.22%) |
function/call Rhai | 📈 view plot 🚷 view threshold | 445.50 ns(-4.75%)Baseline: 467.71 ns | 525.17 ns (84.83%) |
loading/empty Lua | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 1,335,700.00 ns(+596.08%)Baseline: 191,887.90 ns | 1,267,624.08 ns (105.37%) |
loading/empty Rhai | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 1,045,300.00 ns(+128.96%)Baseline: 456,541.00 ns | 1,013,853.69 ns (103.10%) |
math/vec mat ops Lua | 📈 view plot 🚷 view threshold | 6,947.10 ns(-12.28%)Baseline: 7,919.57 ns | 9,349.20 ns (74.31%) |
math/vec mat ops Rhai | 📈 view plot 🚷 view threshold | 6,107.70 ns(-8.05%)Baseline: 6,642.50 ns | 7,344.52 ns (83.16%) |
query/10 entities Lua | 📈 view plot 🚷 view threshold | 18,598.00 ns(-9.32%)Baseline: 20,509.10 ns | 22,607.42 ns (82.27%) |
query/10 entities Rhai | 📈 view plot 🚷 view threshold | 18,245.00 ns(-11.44%)Baseline: 20,600.80 ns | 23,054.27 ns (79.14%) |
query/100 entities Lua | 📈 view plot 🚷 view threshold | 40,720.00 ns(-4.78%)Baseline: 42,766.30 ns | 45,572.89 ns (89.35%) |
query/100 entities Rhai | 📈 view plot 🚷 view threshold | 29,096.00 ns(-13.20%)Baseline: 33,521.00 ns | 38,468.34 ns (75.64%) |
query/1000 entities Lua | 📈 view plot 🚷 view threshold | 258,670.00 ns(-6.55%)Baseline: 276,788.00 ns | 300,959.12 ns (85.95%) |
query/1000 entities Rhai | 📈 view plot 🚷 view threshold | 158,230.00 ns(-6.20%)Baseline: 168,683.00 ns | 183,678.70 ns (86.14%) |
reflection/10 Lua | 📈 view plot 🚷 view threshold | 5,602.70 ns(-9.63%)Baseline: 6,199.85 ns | 6,854.73 ns (81.73%) |
reflection/10 Rhai | 📈 view plot 🚷 view threshold | 14,375.00 ns(-8.71%)Baseline: 15,746.10 ns | 17,072.85 ns (84.20%) |
reflection/100 Lua | 📈 view plot 🚷 view threshold | 48,307.00 ns(-6.65%)Baseline: 51,748.20 ns | 57,315.68 ns (84.28%) |
reflection/100 Rhai | 📈 view plot 🚷 view threshold | 727,880.00 ns(-5.67%)Baseline: 771,670.00 ns | 854,101.06 ns (85.22%) |
resource/access Lua | 📈 view plot 🚷 view threshold | 3,246.70 ns(-8.62%)Baseline: 3,552.92 ns | 3,889.26 ns (83.48%) |
resource/access Rhai | 📈 view plot 🚷 view threshold | 4,824.40 ns(-9.78%)Baseline: 5,347.53 ns | 5,915.30 ns (81.56%) |
resource/get Lua | 📈 view plot 🚷 view threshold | 1,842.70 ns(-9.31%)Baseline: 2,031.89 ns | 2,248.55 ns (81.95%) |
resource/get Rhai | 📈 view plot 🚷 view threshold | 3,660.90 ns(-6.95%)Baseline: 3,934.31 ns | 4,357.79 ns (84.01%) |
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
THe current process for loading/unloading scripts is entirely controlled via
CreateOrUpdate
andDelete
script commands, this is fairly simple but inflexible. Adding new callbacks requires support from the core crate.The new and improved pipeline decentralizes the process of loading and unloading across a new
ScriptProcessingSchedule::<P>
.The schedule contains a multitude of systems which process attachment/detachment and asset modification events. Callbacks themselves are now systems which react to state transitions within this schedule.
The schedule is ran manually via commands (it's not inserted into the
MainScheduleOrder
), specifically whether or not it is run each frame is determined by theRequestProcessingPipelineRun::<P>
resource. A few "frontend" systems listen to user emitted events such asScriptAttachmentEvent
andScriptDetachmentEvent
(now split out from theScriptEvent
enum into standalone structs), and trigger processing pipeline runs.the lifecycle commands like
AddStaticScript
andCreateOrUpdateScript
andDeleteScript
commands have been removed in favour ofAttachScript
andDetachScript
commands, which invoke the necessary events, and immediately run the processing pipeline, resulting in more predictable loading behavior.