Optimize buffer_is_zero
Get series with b4
b4 am [email protected]Versions newest first
- v3 Latest6 patches 12 repliesIn review
Changes in v3 from the cover letter
- 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
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | util/bufferiszero: remove SSE4.1 variantutil/ | +0 | 1 reply | |
| 2/6 | util/bufferiszero: introduce an inline wrapperinclude/ util/ | +47 | 3 replies | |
| 3/6 | util/bufferiszero: remove AVX512 variantutil/ | +2 | 4 replies | |
| 4/6 | util/bufferiszero: remove useless prefetchesutil/ | +0 | 1 reply | |
| 5/6 | util/bufferiszero: optimize SSE2 and AVX2 variantsutil/ | +69 | 1 reply | |
| 6/6 | util/bufferiszero: improve scalar variantutil/ | +11 | 2 replies |
Reviews trailers per patch
5 of 6 patches have a Reviewed-by or Acked-by.
| Patch | Richard Henderson |
|---|---|
| 1/6 | R-b |
| 2/6 | |
| 3/6 | R-b |
| 4/6 | R-b |
| 5/6 | R-b |
| 6/6 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/6] Optimize buffer_is_zero
I am posting a new revision of buffer_is_zero improvements (v2 can be found at
https://patchew.org/QEMU/[email protected]/ ).
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(-)
Signature · 1 line
2.32.0