Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118603 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90444 invoked from network); 10 Sep 2022 16:40:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Sep 2022 16:40:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C81DD1804AC for ; Sat, 10 Sep 2022 09:40:44 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, 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-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 ; Sat, 10 Sep 2022 09:40:44 -0700 (PDT) Received: by mail-ed1-f47.google.com with SMTP id q21so6880487edc.9 for ; Sat, 10 Sep 2022 09:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=ovbMr2SEY5LIB1g6otBnZ+3fp+EoxGFqJfg9M++hadE=; b=f53MGN094uOyoORi/DnPgLNGbkZD8VO8Uf17gNEmwZHaP2ytvz+yFz6gfCHT51xnTZ Wi/G1zu/xRT9dCXUx/fopqnwiKCi9+B+0DFHRs0wRUkVRcpc50X65tCbUYCzKlJSvmp7 shb3tixZ8S3zZNyFtYbFn9IxY4qtlGm9rICkuTUDHxQeVLhdb6NJ0LuUMqt1PhBuVOan KxbkkOxHXigOtIl5A+MhPnYZV8fVSuVhhkHfeQK7rvPYNijJwpbNK2aY03odioGxNJSH 6c6w9t6ZbsOehOi7+Nmf8enj1kAt8v2d70Q2b131V1KSeqPk2a6wArRU+r+ZSGK3Z9Wn 4fKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=ovbMr2SEY5LIB1g6otBnZ+3fp+EoxGFqJfg9M++hadE=; b=uK2V79mgWfH2z0C1KEWR3hdg7qBvJip59T+MNjJavOtxH2dRkvzKHNTWkGVvNlg+Sv cneQzdiU6wGsu9w379+N6vkTGHnZj/tmY95cJHozH8Htp2gf06w3HYD3DwGuXc9KtAMS U+O2zjppXwzSW8HbpsszYjhBl929vEgsm43JCFTGAphYYkUAT2ZeD/1hFwJ/VfPEaikM 694ZdbBIrKPy70siPWQdINJqAKgt7sjqDlkjC+Sx+63Bf3lOVATJIc5VztbNexIjXEVQ cT+Hr9EPNsuAeVayn776BY+gqIR1WM3bwYsFOzjWVEPr8ZgRWzGiYyvCp3GBd43sDX3y ZlHw== X-Gm-Message-State: ACgBeo3YfOsqJYl4cgzYApqzXm/+gtzmyIUoFNyeKnM19zvpFsYiHcAU Ms1SiBV7ts7KwyoAGvsAai3BssP7umczKnzuMtk= X-Google-Smtp-Source: AA6agR6BEkog67pmid8QRk8KLiYYZ1CJq34oAj9e4lZWdlIy/8QKYjFM6Ap0ssDeswUsKusBN5FMo+ZCbiyRdDxsIYU= X-Received: by 2002:a05:6402:ea1:b0:443:d90a:5d31 with SMTP id h33-20020a0564020ea100b00443d90a5d31mr15795616eda.121.1662828042632; Sat, 10 Sep 2022 09:40:42 -0700 (PDT) MIME-Version: 1.0 References: <3ba19901-2a14-3869-0c65-5b4bfed5bcb5@gmx.de> In-Reply-To: Date: Sat, 10 Sep 2022 18:40:05 +0200 Message-ID: To: Eugene Sidelnyk Cc: "Christoph M. Becker" , PHP Internals Content-Type: multipart/alternative; boundary="000000000000cdc3be05e8555234" Subject: Re: [PHP-DEV] Re: str_repeat performance From: divinity76@gmail.com (Hans Henrik Bergan) --000000000000cdc3be05e8555234 Content-Type: text/plain; charset="UTF-8" maybe you'll find $t=microtime(true) - $startTime; var_dump($t,number_format($t,10)); interesting, https://3v4l.org/Ejia3 On Sat, 10 Sept 2022 at 17:11, Eugene Sidelnyk wrote: > Oh, yes. Sorry for that. > > Thanks for pointing out. > > On Sat, Sep 10, 2022 at 3:23 PM Christoph M. Becker > wrote: > > > On 10.09.2022 at 14:19, Eugene Sidelnyk wrote: > > > > > I have noted some strange points about `str_repeat` performance. It > looks > > > like the lesser `$times` argument is, the bigger is execution time > (only > > if > > > we consider big numbers). > > > > > > For example, `str_repeat('%d ', 12500);` is a lot slower than > > > `str_repeat('%d ', 1250000)`. > > > > > > First case (slow one): > > > https://3v4l.org/ZAoGi > > > > > > Second case (fast one): > > > https://3v4l.org/YIdQM > > > > It seems you have misinterpreted the results. 4.792213439941406E-5 is > > certainly much smaller than 0.013129949569702148, for instance. > > > > -- > > Christoph M. Becker > > > > > --000000000000cdc3be05e8555234--