Repository navigation
Conversation
makspll
added this pull request to stack #649
October 22, 2026 17:45
Contributor
|
| Project | Bevy Scripting |
| Branch | agent/script-systems-perf |
| Testbed | linux-gha |
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
🚨 3 Alerts
🐰 View full continuous benchmarking report in Bencher
makspll
force-pushed
the
agent/script-systems-perf
branch
from
October 23, 2026 12:07
7ba5a13 to
d0c0e88
Compare
- `ScriptValue::Entity(Entity)`: entities never allocate, `V<Entity>` converts to and from it, entity fields read as values. Lua (`LuaEntity`) and Rune (`RuneEntity`) resolve its methods through `static_index(Entity)` - query results convert to lists of the entity followed by the components (`result[1]`, `result[2]` in Lua) instead of allocated references, the `entity()` / `components()` script functions are removed - `script_systems` macro benchmarks: iterating 1000 query results goes from 2.08ms to 1.27ms
- `ScriptValue::Value(InlineValue)` replaces `ScriptValue::Entity`: `V<T>` stores any `T` of at most 16 bytes without drop glue inline, decided at compile time, with a per-type vtable (type id, reflect, promotion) - languages hold it in one generic wrapper (`LuaValue` / `RuneValue`) and promote it in place to an allocated reference before anything which needs a place (fields, assignments, mutating methods, iteration), so scripts can't tell values from references; field reads stay references - `R<T>` holds a copy of an inline value (exact type only, like references), `dispatch::binary`/`unary` take inline operands, `dispatch::index_value` finds non-mutating methods - functions matching `ScriptValue::Reference` on a `ScriptValue` argument accept values (`eq`, `EnumVariantRef::eq`, `trigger_event`)
makspll
force-pushed
the
agent/script-systems-perf
branch
from
October 23, 2026 12:10
d0c0e88 to
3bf0796
Compare
…-perf # Conflicts: # crates/bevy_mod_scripting_core/src/script_system.rs
…-perf # Conflicts: # docs/src/ReleaseNotes/0.23-to-0.24.md
This branch has not been deployed
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
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.
Stacked on #651. Last of the script system PRs.
Inline values (generic, second commit)
ScriptValue::Value(InlineValue):V<T>returns anyTof at most 16 bytes with no drop glue (e.g.Entity,Vec3,Quat) stored inline instead of in an allocated reference.const fn is_inline::<T>()inside the monomorphizedIntoScript for V<T>), so no registry lookups.as_reflect,into_reference.LuaValue/RuneValue) holds the inline value:dispatch::index_value), operators and printing use it directly.M<T>methods, iteration) first promotes it in place to an allocated reference, i.e. what everyV<T>result was before. Variables sharing the value see the change.R<T>holds a copy of an inline value, exact type only like for references (a structuralfrom_reflectmade a union pickVec3for aQuat). Its field is private now.V<T>converts like from a reference.M<T>only accepts values as a promoted receiver.Plain list query results (first commit)
{entity, a, b}(result[1],result[2]in Lua,result[0],result[1]in Rune), from script systems and fromworld.query():build().entity()/components()script functions are removed.Numbers (medians of 3 interleaved rounds against #651, ns)
Things that behave differently
ScriptValues getsValuefor small types (one test updated).ScriptValueand matching onlyReferencesilently miss values. Three are fixed:eq,EnumVariantRef::eq,trigger_event. Third-party code needs the same treatment (migration notes).M<T>errors, or with a rawReflectReferencemutates a copy. No bindings in the repo do this.Tests
value_semanticstests (aliasing, copy on assignment, fields are places, equality between field references and values).🤖 Generated with Claude Code