From: Alexander Monakov <amonakov@ispras.ru>
To: qemu-devel@nongnu.org
Cc: Mikhail Romanov <mmromanov@ispras.ru>,
Richard Henderson <richard.henderson@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Alexander Monakov <amonakov@ispras.ru>
Subject: [PATCH v3 0/6] Optimize buffer_is_zero
Date: Tue, 6 Feb 2024 23:48:03 +0300 [thread overview]
Message-ID: <20240206204809.9859-1-amonakov@ispras.ru> (raw)
I am posting a new revision of buffer_is_zero improvements (v2 can be found at
https://patchew.org/QEMU/20231027143704.7060-1-mmromanov@ispras.ru/ ).
In our experiments buffer_is_zero took about 40%-50% of overall qemu-img run
time, even though Glib I/O is not very efficient. Hence, it remains an important
routine to optimize.
We substantially improve its performance in typical cases, mostly by introducing
an inline wrapper that samples three bytes from head/middle/tail, avoid call
overhead when any of those is non-zero. We also provide improvements for SIMD
and portable scalar variants.
Changed for v3:
- separate into 6 patches
- fix an oversight which would break the build on non-x86 hosts
- properly avoid out-of-bounds pointers in the scalar variant
Alexander Monakov (6):
util/bufferiszero: remove SSE4.1 variant
util/bufferiszero: introduce an inline wrapper
util/bufferiszero: remove AVX512 variant
util/bufferiszero: remove useless prefetches
util/bufferiszero: optimize SSE2 and AVX2 variants
util/bufferiszero: improve scalar variant
include/qemu/cutils.h | 28 ++++-
util/bufferiszero.c | 280 +++++++++++++++---------------------------
2 files changed, 128 insertions(+), 180 deletions(-)
--
2.32.0
next reply other threads:[~2024-02-06 20:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 20:48 Alexander Monakov [this message]
2024-02-06 20:48 ` [PATCH v3 1/6] util/bufferiszero: remove SSE4.1 variant Alexander Monakov
2024-02-06 22:24 ` Richard Henderson
2024-02-06 20:48 ` [PATCH v3 2/6] util/bufferiszero: introduce an inline wrapper Alexander Monakov
2024-02-06 22:44 ` Richard Henderson
2024-02-07 7:13 ` Alexander Monakov
2024-02-08 20:07 ` Richard Henderson
2024-02-06 20:48 ` [PATCH v3 3/6] util/bufferiszero: remove AVX512 variant Alexander Monakov
2024-02-06 22:28 ` Richard Henderson
2024-02-06 23:56 ` Elena Ufimtseva
2024-02-07 6:29 ` Alexander Monakov
2024-02-07 10:38 ` Joao Martins
2024-02-06 20:48 ` [PATCH v3 4/6] util/bufferiszero: remove useless prefetches Alexander Monakov
2024-02-06 22:29 ` Richard Henderson
2024-02-06 20:48 ` [PATCH v3 5/6] util/bufferiszero: optimize SSE2 and AVX2 variants Alexander Monakov
2024-02-06 23:10 ` Richard Henderson
2024-02-06 20:48 ` [PATCH v3 6/6] util/bufferiszero: improve scalar variant Alexander Monakov
2024-02-06 22:34 ` Richard Henderson
2024-02-06 22:46 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240206204809.9859-1-amonakov@ispras.ru \
--to=amonakov@ispras.ru \
--cc=mmromanov@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).