[systemd-devel] [PATCH 1/2] Optimize startswith() to macro

Lennart Poettering lennart at poettering.net
Wed Sep 11 06:04:01 PDT 2013


On Fri, 23.08.13 14:09, WANG Chao (chaowang at redhat.com) wrote:

> > > - Why not use startswith() instead of first_word()?
> > first_word is not equivalent: there must be a word boundary after the
> > word:
> 
> Yeah, you're right. I occasionally got carried away at midnight :(
> 
> And I think a inline static version could be a little faster? Right?

Not necessarilly. On today's CPUs often smaller code results in faster
execution than avoiding function calls...

If we shift this around further we probably should do it properly and
play around with benchmarks...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list