qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] [qemu-img] CPU consuming optimization


From: Dmitry Konishchev
Subject: Re: [Qemu-devel] [PATCH] [qemu-img] CPU consuming optimization
Date: Wed, 18 May 2011 14:27:29 +0400

On Wed, May 18, 2011 at 1:40 PM, Peter Maydell <address@hidden> wrote:
> You could assert() this:
>  assert(argc % (4 * sizeof(long)) == 0);

Yeah, but actually I'm not really like the idea to include asserts in
the little bottleneck functions if the configuration script doesn't
include -DNDEBUG in the compiler cflags by default. Because in this
case it's yet additional instructions on which CPU pipeline is going
to stumble upon + it also decreases the chances for this function to
be inlined by the compiler. But inlining can give us an additional
boost + compiler will be able to understand that, in the place where
the function is inlined, it is always called with len == 512 and
optimize the code for this case by automatically unroll the loop and
so on.

But in the bottom line I don't really mind to include the assert -
just believe that it's not really worth it.

-- 
Dmitry Konishchev
mailto:address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]