Victor Vianna
unread,Jan 20, 2026, 8:15:20 PM (5 days ago) Jan 20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cxx, jdoe...@chromium.org, Elly, Victor Vianna, cxx, Avi Drissman
> From what I read, the compiler may be smart and optimize the parameter away, but that's not guaranteed. Marking the method as static guarantees better performance and code clarity.
Quick update: Jan's reply prompted me to try to analyze if
crrev.com/c/7481309 brings any perf diff at all when compiling with -O2. I'm still figuring out the correct incantation of -fsave-optimization-record + llvm-remarkutil but preliminary findings show that this change is probably not worth the churn. So I'll likely just drop it.
> Note that this feature also applies to capture-less lambdas. All of those could be made static, too. This wasn't done by default, since it would break existing code, as explained in the
proposal. Do you intend to migrate those too? I probably wouldn't, as the added noise is substantial here and I trust compilers to optimize lambdas.
Thanks, I didn't know about the static lambdas. Yeah, there are too many lambdas in chromium, unless there is a huge benefit we shouldn't migrate.
> Regardless, we should also update `base::BindOnce` and friends to support functors with static call operator.