This value remains stable, so cache it to avoid unnecessary
computations.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential D48034
sound: Cache bps in pcm/feeder_eq.c christos on Wed, Dec 11, 4:49 PM. Authored by Tags None Referenced Files
Subscribers
Details
This value remains stable, so cache it to avoid unnecessary Sponsored by: The FreeBSD Foundation
Diff Detail
Event TimelineComment Actions Why not just cache it in a local variable? That's probably cheaper, even though the "computation" here is trivial anyway. Comment Actions I'm skeptical that this change makes any measurable difference. And, as suggested, it'd be more natural to cache the value in a local variable instead, assuming that the compiler doesn't recognize that the value is constant and hoist that computation out the loop (which would make this diff even less useful).
Comment Actions Does this diff actually change the generated code? We should avoid these kinds of microoptimizations unless they can be proven to be useful. Comment Actions I guess the change is either not-noticeable, or non-existent. Perhaps it's better to skip this patch. |