Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130457 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 776911A00BC for ; Wed, 25 Mar 2026 20:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774468934; bh=zaGgN6TUhmW1PN9lgY5SzkDsbQ9JqFa5yJfh3mhkzMs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oIfnFVw6PQdKJ8FxMgttKp9UEYhpUdCJleIvxp+RDbZe2ewbLFF4E1wCv8kffsVLw oS9IgnLDMD3lVN44PlGbvup6cqrRViXObIhYILqMWLpzap6hdo7tsR7XSeJiE0XYEa YSVjElV8ELiaG5x/kYjeZtT8HVnEkDr044uLQawTGdJKEgabSE81but8TVJxvSuyJF XznxFiEiP871GPcW7aTJ8n1bce4yBGyTTJ4EaOKo8xUmtuSXKCeZZ6zywn6ftZx1k8 sJ5IgLkWqVn+197g7t6cE2cDU50MUvFM3TshPwhU20nPLw/XoZO/gSY27KXpupnXFK 5JSy5sU+FDzMA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F32BB180077 for ; Wed, 25 Mar 2026 20:02:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 25 Mar 2026 20:02:09 +0000 (UTC) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b97a9f4b4dcso24821066b.3 for ; Wed, 25 Mar 2026 13:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774468923; cv=none; d=google.com; s=arc-20240605; b=ABDO3opuZTU7EhAr5r1qYkdaFI+866JM4/Q6bTARkTZiVUYDivksuUTZM+mxyX841j ulml6/G2Rbk/RW9e/SFEoQEvUuO3TwYnnKLSQBXIYZXvQ9p9K7U0sdgmRRWv7OHtsjAM z/IT8lyhZP1J+ttX9WMc5yq6pfvDVy2RMOa323wj5qbjZTj5AzXNq7ZILoMkSqkcXU/j yjAq+2Kf3ggV+d+WM7bXUrugX004sevnD0swD/ChM+YtfwrOEnv6Sk+F2cTKW+oWyfxp itQCy1K7uJqvo4JAjDS1RsYb+jVRPVkPWl+4hMQGoMT9M+vH4k3rqbAl26XX7gS5367v sDWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=GKtrQbPAYttT8np4lBc/Tc6bBLTBtIK61v+E+y2JJ8U=; fh=+wdQTjQc107VFxWOsn/Jk1InU3o2wtQuI0/Vg9jJqqk=; b=V7PAb529Nmzp2cOGJY2Cfp6MpyRoYNO5Y91XY7eLYfpPWH6QYMxMnNlxMVWvuKV7wv zvATMigP88DeIKZ7N3veFoL2ExxNrMDjNhgJoNMARRvkdciz3CIspl3gm/9BP4Hju4ML 5HAwSuISEXzOzEq3Uk2B1UjBN/fXVAc48gqFPLQfIkXwOQJxv9MVVD+rvESrBI8JM4x7 0IFDOgNLp8VdetkCIGLRePVRgGuhgcry601xutA4wuCRIqPmHjFkR42lfT8OlqlMg8PC Z8O2PoaxLIpqfUPnpLZQA6P2b/LAVcKj/5jXEPWQwTVCEuMtjOJtJa1F+Yrf/q2oMm6S L5eQ==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20230601.gappssmtp.com; s=20230601; t=1774468923; x=1775073723; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GKtrQbPAYttT8np4lBc/Tc6bBLTBtIK61v+E+y2JJ8U=; b=PTQfZosVLenp2wobdJE9h5mmfPypEKWsuzXZtKShv8T0rG5m35O2nanwvp+ptWBFfC xEOv4EKlO3CHHyoK5oNSlMmLaLIDOjOr+YTeJBPcvSgQW1ugG1O6k0IUgYmaq5Wz8sXm MTFgI9qUHTniaONIe3fI4PWEYCcJLcs99s2kUMLV3TT0E2bL3RR2OFZndgVM+C0r7G1s 7hOHHSHrfq/7jXfia5WJv2JFd1HfY8Ovfsh685kzN4JuMUQ5CDvbsuWq0bN6D/TP5cRu JHTgI8NHKHLFtAmGxsfvrJLgRuFxwnpMZ5FE0mexvubdvJruK6xoijOv9b+M/ojfnttm nkkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774468923; x=1775073723; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GKtrQbPAYttT8np4lBc/Tc6bBLTBtIK61v+E+y2JJ8U=; b=LpdMXGh0Ivk9rIV8q44WQc+NA63h0oQvz+hTnpqgJ+MPpS5MCC5Qm/TBOTny81YLS9 gKiwCftP8cuN3YSnqqz4KZNI70KdgS7a21FqDvthAqtC+DrvsNxQVUHKgKmKsN2CMfo3 LI2kjhpC4cR8M45EHLPiO4wGu1dVRxLPANAMX1e28v4O6nI6Sd9O0jlPR9tiR7WRb/ya nJrs2+bTpKOzlEnXoHdj5VWiu75IW+NDxWKMOAWWiqk0V/2oepZm6B33R2BEzvj5/K/N fnjnMkBSlFQdMt1RZvMzgCWnpvxtFq5+SUfiSPwTIaURzUk3Q8ordvjApuGMfR20Ck6M jEig== X-Gm-Message-State: AOJu0YyUYTgv4MDWlix80iHYch99SCGZAmuKrPsOz4nOFS+247imfYO4 hkyarC+NrzsCntuzB3t23hx/2vQsqCvvoCJbt2+jCg1YlT757Uj7lk9Q/vBrQ4rPeCQAkH0vbcD phlcbJcvkoe4VR5pUvFb45pzm8KAIYVzlYHmC2DCUIA== X-Gm-Gg: ATEYQzysybxAyQVDlkBumsZOQBZR9Sp0gJh4U1r4Q/6sGGw8jkImBtM6/uKTnImeaJk 2usDu4f2TIbTI4EvjYY2y7k+dX6DhBbctxbMIffr44sYlFE8Hm4LimC5aDmz4b4FP2VxJ3Qknj3 ZW7D4qQ3xQmLshzUYLbYDwoDxHktW5mVtpV1tGRpa3tB0QHdV20dS2bDMzivtpxyww+YDMJB8vn nM/jAmdVSv7xxrHTQBf1rmMls6lhvsUB2Dul/wz7Wx/9ycMcTdlJC+pt0pu/YUv+FKswWZPyFie fb57cRY= X-Received: by 2002:a17:907:e113:b0:b98:2496:1b0f with SMTP id a640c23a62f3a-b9a3f187349mr271020366b.20.1774468923494; Wed, 25 Mar 2026 13:02:03 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 25 Mar 2026 15:01:47 -0500 X-Gm-Features: AQROBzBgHlkA1AOeyNh5azyT73k-TbjOpFODX1ncdWKyXaWpQ-YPSRadEDiXOiY Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] SIMD-Accelerated CRC via crc-fast for ext/hash To: Michael Wallner Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000d9a358064ddebddf" From: php@golemon.com (Sara Golemon) --000000000000d9a358064ddebddf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 17, 2026 at 5:41=E2=80=AFAM Michael Wallner wrot= e: > We would like to open the discussion on SIMD-Accelerated CRC via > crc-fast for ext/hash. > > RFC: > https://wiki.php.net/rfc/crc-fast > > PR: > https://github.com/php/php-src/pull/20513 > My initial reaction on seeing this RFC (just browsing wiki.php.net/rfc, not from the email) was "Why give this a new name?" Would it be too onerous to support transparently upgrading calls to hash('crc32'), hash('crc32b'), and crc32() to just use the faster implementation when available? (P.S. - Luagh/Cry that this library has a flag for our "quirk".) The build system define should provide all the signal we need, but a cached CPU capabilities check could be added for belts and suspenders. Or is there a reason to doubt the reliability of the faster algorithms? My desire here is to make choosing the better option easier than choosing the wrong one. A developer who knows what they're doing can interrogate hash_algos(), but that's harder to cache and misses some of the performance boost in the happy path, and makes it worse in the sad path. -Sara --000000000000d9a358064ddebddf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Feb 17, 2026 at 5:41=E2=80=AFAM Michael Wallner &l= t;mike@php.net> wrote:
> We wo= uld like to open the discussion on SIMD-Accelerated CRC via
> crc-fas= t for ext/hash.
>
> RFC:
> https://wiki.php.net/rfc/crc-fast
>
> PR:> https://github= .com/php/php-src/pull/20513
>

My initial react= ion on seeing this RFC (just browsing w= iki.php.net/rfc, not from the email) was "Why give this a new name= ?"

Would it be too onerous to support transparently upgrading c= alls to hash('crc32'), hash('crc32b'), and crc32() to just = use the faster implementation when available?=C2=A0 (P.S. - Luagh/Cry that = this library has a flag for our "quirk".) The build system define= should provide all the signal we need, but a cached CPU capabilities check= could be added for belts and suspenders.

Or is there a reason to do= ubt the reliability of the faster algorithms?=C2=A0 My desire here is to ma= ke choosing the better option easier than choosing the wrong one.=C2=A0 A d= eveloper who knows what they're doing can interrogate hash_algos(), but= that's harder to cache and misses some of the performance boost in the= happy path, and makes it worse in the sad path.

-= Sara


--000000000000d9a358064ddebddf--