From 1d86a0b632813efb2259b795b272f8aa40a7c768 Mon Sep 17 00:00:00 2001 From: Noel Grandin <noel.grandin@collabora.co.uk> Date: Fri, 27 Oct 2023 11:18:13 +0200 Subject: tdf#152571 speedup slow draw file save with lots of images, we seem to spend lots of time calculating CRC. Replace the vcl checksum/CRC with rtl_crc32 in sal/, which forwards to the zlib implementation, which has all kinds of nice SIMD code for performance. Change-Id: I295e2ee91b3450fa558b06e67aac0fbb20b85f52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158529 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> --- vcl/source/bitmap/bitmappalette.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vcl/source/bitmap/bitmappalette.cxx') diff --git a/vcl/source/bitmap/bitmappalette.cxx b/vcl/source/bitmap/bitmappalette.cxx index e0bf53db033e..97bfe4a62051 100644 --- a/vcl/source/bitmap/bitmappalette.cxx +++ b/vcl/source/bitmap/bitmappalette.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <osl/diagnose.h> +#include <rtl/crc.h> #include <tools/helpers.hxx> #include <vcl/BitmapPalette.hxx> @@ -120,7 +121,7 @@ BitmapColor* BitmapPalette::ImplGetColorBuffer() { return mpImpl->GetBitmapData( BitmapChecksum BitmapPalette::GetChecksum() const { auto const& rBitmapData = mpImpl->GetBitmapData(); - return vcl_get_checksum(0, rBitmapData.data(), rBitmapData.size() * sizeof(BitmapColor)); + return rtl_crc32(0, rBitmapData.data(), rBitmapData.size() * sizeof(BitmapColor)); } bool BitmapPalette::operator==(const BitmapPalette& rOther) const -- cgit