Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116883 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5748 invoked from network); 17 Jan 2022 04:26:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jan 2022 04:26:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6329F1804C3 for ; Sun, 16 Jan 2022 21:37:04 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 16 Jan 2022 21:37:03 -0800 (PST) Received: by mail-qt1-f172.google.com with SMTP id x8so12155842qta.12 for ; Sun, 16 Jan 2022 21:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oNWfzexMvfTEuY7kAnzf6nMfyrDl192vRRk42CNAopM=; b=Ya6DEz5cH/1uH5ULGVJf55cKd93q6NmR+Fo0tbdB37UaINpfjmzIQPYyKl/8xkT057 gxAFrjR7oA5UVOe+CsK89D/S0Nz/uIvmilyK59erPJGuv7O521zQs3o0PphgheMhP175 4OIrC/dVdhnNvzz4GSwjdu70psqbv/IDZrFAZ70wuAIW/mQbdmLgl/fwDF2Yye7HbUCq qkdJ+ntCSjC4+szLEwYD2nskP0BOGJHdyHvVhI0kUfXp2m5EzAGqZGT3X9Tj0ZEqshcZ kEsdOpI9/TeHkKdD2oo3dp8DYxD4LQ3Zn7rPHw57ZML8llynkbVwAKZVySVBdu2F3H2Y L48Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oNWfzexMvfTEuY7kAnzf6nMfyrDl192vRRk42CNAopM=; b=kTQsW5FwWz11glmuYbVm9V66fA7uWMC+gWpG0aHptpcCT5Jr+wk+dmrWuudP6q6aY0 EO+AL+sasBa552EjkxtaaObRYWVGirkPj4SSEzrEeEfZco90Cy6Tt9yaoHT2to5thasU p1zFfXiXI29EYfs8xXHMX0NfgUQVFm0P8vuhCWkt3wuJWVFvvp4h3OWWNgmBAOyvFav+ 7JOHryQz16cg3aZLlsB+kIFA1s0+O9wD9g0ENDbhcoFkN5csBi/oLD12MNQXlXx+Ld8+ 5dJo6KRYZZUSJUWmhQi40dmvZd3Uyy6OmRViquEEAVuWR253yqsSIlwqsa/+armOGZhH zULw== X-Gm-Message-State: AOAM5300OqcWGmW6JFhavs1Q9G5I+EpjFtxgNPoPzVua9w3BTGcAg21H Dn2bHRqHA/r5RU+KQQ7ZhDNoCEGTDOe9RIFVKiQ= X-Google-Smtp-Source: ABdhPJz0PDvkrJOX1/L9HIEF4YRC4Rm0fTn+WlPIqCUrpRtdHlaWXV5J0pVhtnyBTYB47J76bTBgs5bD5IGy8pmBL+E= X-Received: by 2002:a05:622a:1013:: with SMTP id d19mr16166723qte.151.1642397823014; Sun, 16 Jan 2022 21:37:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 17 Jan 2022 08:36:52 +0300 Message-ID: To: "Su, Tao" Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000d21a5d05d5c08a43" Subject: Re: [PHP-DEV] Reason for ZEND_JIT_COUNTER_INIT set to 32531? From: dmitrystogov@gmail.com (Dmitry Stogov) --000000000000d21a5d05d5c08a43 Content-Type: text/plain; charset="UTF-8" This it's my choice. This number is common for all JIT counters (hot_loop, hot_func, hot_return). It's value was selected to provide the best precision when different counters have different thresholds. Unfortunately, I can't remember the exact equations or logic I used at that time. Thanks. Dmitry. On Thu, Jan 13, 2022 at 1:01 PM Su, Tao wrote: > Hi Internal, > I am not sure this is a correct mail list for asking source code related > question. > If not, I am sorry. Appreciate you guys' help. > > I am reading PHP8 JIT related source code and found that zend_jit.h has a > magic definition > ZEND_JIT_COUNTER_INIT as 32531 which I do not quite understand how this > number was chosen and why? > Anybody can provide some historic information? > #define ZEND_JIT_COUNTER_INIT 32531 > > A code example using this definition (looks like the 2nd parameter > computes into a fixed number if hot_func is set by php.ini) > ZEND_OPCODE_TAIL_CALL_EX(zend_jit_trace_counter_helper, > ((ZEND_JIT_COUNTER_INIT + JIT_G(hot_func) - 1) / > JIT_G(hot_func))); > > > ======================================= > Tony Su (Su, Tao) > make a 'lazy' programmer diligently with efficiency > > --000000000000d21a5d05d5c08a43--