Performance improvement
Jin Liu
m.liu.jin at gmail.com
Fri May 23 03:52:50 BST 2025
Igor Mironchik <igor.mironchik at gmail.com> 于2025年5月23日周五 00:21写道:
>
> Hi.
>
> I'd like to ask you, guys, maybe I'm a dumb a little, and you know how
> to optimize a following function.
>
> inline long long int
> skipIf(long long int startPos, const QString &line,
> const std::function<bool(const QChar &)> &pred,
> long long int endPos = -1)
Since you have a very simple inner loop, changing `pred` from
`std::function` (essentially a function pointer) to a template
parameter might help a bit with inlining if `pred` is simple.
More information about the kde-devel
mailing list