Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121546 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94414 invoked from network); 31 Oct 2023 15:56:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 Oct 2023 15:56:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D8A78180504 for ; Tue, 31 Oct 2023 08:56:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 31 Oct 2023 08:56:33 -0700 (PDT) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-53fa455cd94so4327582a12.2 for ; Tue, 31 Oct 2023 08:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698767792; x=1699372592; 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=pLgqoM0FC9faqpcPDaQbzsyVFBzdwMz0fbPi77u6Y7I=; b=hEtg/dCyarkYcbVJpVrh+M+/UtH5vfojLoxEzOIwANcMZ0JsCufdSzmByhYIjguHsi mu6I34Q+apv8BQ4LLaBB91Jt+Fmuv7tvO+MqADOZw+nzSLWbTOFaJKQqcPy+k+vJYXAj lupd1yorNKhx7WxrPfxIe0cuaxSz2a/ytuPueNvcZj0QPR4RNXXwd0SmrGX2hlLLzNPz B5jrcncut5d4MhcsdWSuWRto49ml73AcsX+H/YdZZn9M88DPQ3NsRnQ3eR8+aAJSHBYP ScuUwaQOkjMLvtxP2MX2nkfT8k8xmiIWZnYBr/2cCPdJy2p6wn5VAxliJ4KJwIeb6jzc 9/UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698767792; x=1699372592; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pLgqoM0FC9faqpcPDaQbzsyVFBzdwMz0fbPi77u6Y7I=; b=bNn9s3gWMKeZRYP02ULyxvWycSw0/DJPGYDMG+W2uag6TpFMiIi28imKz2NheKlHNN ZV2HiVOyFj2IrNHjacexVl7xDgMCCsxY6JumqUWMUH+sPJ00YZtya0emunlOD8bqOjaM u6SLtwexd3houTNspAodlxbGhGo0Ot9jQDsI5x+s719KFD8hC3bBJf2QFAX4lr6uvqbG uFFEU7b+3fkaP1sinh2TElG2mzQ5e6L5esw5CiUDQctHwlHD17maI9Oe6UYFUcsVkEko lfAat3yWAZ/GpHSMdjFLFqh0FWI5ZLDrxwI6KpgszY5X9BQqwv/u3aO4TPK1IOuOJFX8 hYTg== X-Gm-Message-State: AOJu0YxZ8watUBMzuMch6PsIjr7ci4aUI6fJqsN5MlnEJ0OqTeLPMITi QPsPRzEXcov6kg/3Iy2eIHNX/SIp13wZiTJ839A= X-Google-Smtp-Source: AGHT+IE9kfjz3RCegQIyJTh4SZ9/MW0wlV10/p0xA3b+X1oQphQaGX5Bem0s0dsMHW2ve1nlbu3R2C26AFkILCYctqM= X-Received: by 2002:a17:90a:d998:b0:27d:5be:f218 with SMTP id d24-20020a17090ad99800b0027d05bef218mr11280467pjv.23.1698767792143; Tue, 31 Oct 2023 08:56:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 31 Oct 2023 22:56:22 +0700 Message-ID: To: tag Knife Cc: "Su, Tao" , PHP internals Content-Type: multipart/alternative; boundary="000000000000ce80b8060905328a" Subject: Re: [PHP-DEV] Make PHP JIT to generate AVX2/AVX3 for performance improvement? From: pierre.php@gmail.com (Pierre Joye) --000000000000ce80b8060905328a Content-Type: text/plain; charset="UTF-8" On Tue, Oct 31, 2023, 3:57 PM tag Knife wrote: > > Hi Guys, > > > > A quick question: is it possible to enable AVX2/AVX3 in PHP JIT generated > > code, and hence can get some performance improvement? > > Just check the community first: if anyone has already tried that or got > > some experiences? before we dive into this investigation. > > We are discussing if we could get some extra performance via new AVX > > instructions in PHP program execution. > > > > Thanks. > > > > AVX3 might be too new to just flat out generate for it. But > It can be quite simple for the JIT compiler to be aware of what > features flags are enabled on a CPU and generate compatible > instructions that will run on that CPU. > it is not really new, however the gain for most cases are not necessarily significant but for specific cases. For most usages in php, at a request level, the gain will be barely measurable. Also for latest avx, most hosting servers won't have them anyway. I would think some specific APIs to prepare specific data to be processed using the best available runtime intrinsics would bring much more than in JIT. As a sidenote, most libraries used by php, where larger intrinsics vectors bring something, implement them already. best, Pierre > --000000000000ce80b8060905328a--