From: Vsevolod Stakhov Date: Thu, 4 Dec 2025 15:41:56 +0000 (+0000) Subject: [Fix] Avoid repeated simdutf implementation detection on each call X-Git-Tag: 3.14.2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d30ba509d6fa76fb4a1e365b931fe08a6347542d;p=thirdparty%2Frspamd.git [Fix] Avoid repeated simdutf implementation detection on each call The previous code stored a pointer to simdutf's proxy singleton instead of the actual implementation, causing detect_best_supported() to be called on every UTF-8 validation operation. --- diff --git a/src/libutil/cxx/rspamd-simdutf.cxx b/src/libutil/cxx/rspamd-simdutf.cxx index 8114038845..219ec82057 100644 --- a/src/libutil/cxx/rspamd-simdutf.cxx +++ b/src/libutil/cxx/rspamd-simdutf.cxx @@ -28,8 +28,8 @@ const simdutf::implementation *ref_impl{nullptr}; void rspamd_fast_utf8_library_init(unsigned flags) { - impl = simdutf::get_active_implementation(); auto all_impls = simdutf::get_available_implementations(); + impl = all_impls.detect_best_supported(); for (auto &i: all_impls) { if (i->name() == "fallback") {