@@ -630,18 +630,28 @@ impl_tick_filter!(
630
630
) ;
631
631
632
632
impl_tick_filter ! (
633
- /// Filter that retrieves components of type `T` that have been changed since the last
634
- /// execution of this system.
633
+ /// Filter that retrieves components of type `T` that have been changed since the last tick.
635
634
///
636
- /// This filter is useful for synchronizing components, and as a performance optimization as it
637
- /// means that the query contains fewer items for a system to iterate over.
635
+ /// All components internally remember the last tick they were added at, and the last tick they
636
+ /// were mutated at. The mutation detection is powered by [`DerefMut`](std::ops::DerefMut), such that any mutable dereferencing
637
+ /// will mark the component as changed. Note that there is no deep value inspection on the actual
638
+ /// data of the component, which would be prohibitively expensive. This means false positives can
639
+ /// occur if dereferencing via [`DerefMut`](std::ops::DerefMut) but not changing any component data.
640
+ /// Just reading the value of a component will not mark it as changed, as [`Deref`](std::ops::Deref) will be used instead.
638
641
///
639
- /// Because the ordering of systems can change and this filter is only effective on changes
640
- /// before the query executes you need to use explicit dependency ordering or ordered
641
- /// stages to avoid frame delays.
642
+ /// This filter is useful for synchronizing components. It can also be used as a performance
643
+ /// optimization in case of expensive operations, by filtering unchanged components out and
644
+ /// returning via the query only the components which changed. However, note that like all
645
+ /// filterings, applying this filtering has a small cost, which must be balanced against the
646
+ /// cost of the operation on the changed components.
642
647
///
643
- /// If instead behavior is meant to change on whether the component changed or not
644
- /// [`ChangeTrackers`](crate::query::ChangeTrackers) may be used.
648
+ /// Because by default the ordering of systems within the same stage is nondeterministic, and this filter is only effective
649
+ /// on changes detected before the query executes, to avoid frame delays you need to use
650
+ /// explicit dependency ordering or ordered stages to ensure the detecting system where the
651
+ /// query is used runs after the system(s) which mutate the component.
652
+ ///
653
+ /// To instead retrieve all components without filtering but allow querying if they changed
654
+ /// or not since last tick, you can use [`ChangeTrackers`](crate::query::ChangeTrackers).
645
655
///
646
656
/// # Examples
647
657
///
0 commit comments