-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Description
The redundant work in
validate_param, which is done immediately beforeget_paramnever felt great to me. This isn't a problem exclusive to Res/ResMut, but it is certainly present.I think doing validation as part of
get_paramis more defensible from a performance perspective.I think it is worth doing some benchmarks where we skip validation (as-in, across all SystemParams), just to see what price we're paying here.
IMO the best way to restructure this would be to have get_param return a Result<Self::Item, SystemParamValidationError>, effectively combining the signature with validate_param.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Type
Projects
Status
Needs SME Triage