Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79712 invoked from network); 23 Oct 2014 12:47:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2014 12:47:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.214.179 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.214.179 mail-ob0-f179.google.com Received: from [209.85.214.179] ([209.85.214.179:41018] helo=mail-ob0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/26-41150-8F8F8445 for ; Thu, 23 Oct 2014 08:47:52 -0400 Received: by mail-ob0-f179.google.com with SMTP id wp4so672576obc.10 for ; Thu, 23 Oct 2014 05:47:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wlrWyBu3TfczGOwU7rLmZNRbP8S/2I8ZyfWTAB6lIC0=; b=F3zsdUgRoeoqcTnJm3Qz+PbL9edixy0s83XniXytei3aSb3S9dN5T2HLJHJI8/mGJv 9T87N+8EF8TKCVuUucyiT2rZc8MzO6A/llVlvwFaFyIrc4CrKBw5qNENj1i6UqSwET8q ybv1WaENWJusEv/x0YLI0DYsVwTDln1c7mKUxbi0pAroF38W+w+v1C2lO33FznxjM29V K9usAFwq0Uz6oXqE7/mPzkVh44hr4vD4qLzzXojxBVA16nx0SoXzIvlW2DnKQ9lHdKLh Way0/RAiVPOTFXJtANM4Et+FjH3mkyZo6wggr0maMjw5JWIn9gjjPyc9xQJmw470dbC2 4OKg== X-Gm-Message-State: ALoCoQkG3YAXsjvkHfuAnHymWZzlVNfo/9CfEKppeI/TV1Vfv37dDL+nUiAt4e592avSnhM04f/BpWurcD7pcFnsNReKk3fU86BBX/65puvLIFWrWbQYoVCw75IJmEQRvaxBlE1l6EAaHRNVHhd069M3DmJ/NgWTHQ== MIME-Version: 1.0 X-Received: by 10.202.205.147 with SMTP id d141mr1760980oig.67.1414068468805; Thu, 23 Oct 2014 05:47:48 -0700 (PDT) Received: by 10.60.70.41 with HTTP; Thu, 23 Oct 2014 05:47:48 -0700 (PDT) In-Reply-To: <68229C26-4EEC-49DC-BA05-D5AC9728D1E8@ajf.me> References: <8C47FA53-0964-49C0-963C-332A936348A5@ajf.me> <68229C26-4EEC-49DC-BA05-D5AC9728D1E8@ajf.me> Date: Thu, 23 Oct 2014 16:47:48 +0400 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11352f46c58bce050616785c Subject: Re: [PHP-DEV] [RFC] Big Integer Support From: dmitry@zend.com (Dmitry Stogov) --001a11352f46c58bce050616785c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Andrea, The synthetic benchmarks are not always reflect the impact on real-life performance. Unfortunately, I wasn't able to run any big real-life apps with your bigint branch, because it misses support for commonly used extensions (ext/session, ext/json, ext/pdo). I ran bench.php and it's a bit slower with bigint. master 1.210 sec bigint 1.330 sec I also measured the number of executed instructions using valgrind --tool=3Dcallgrind (less is better) master 1,118M bigint 1,435M May be part of this difference is caused by missing latest master improvements, but anyway, introducing new core type, can't be done for free= . I also was able to run qdig, and it showed about 2% slowdown. [master] $ sapi/cgi/php-cgi -T 1000 /var/www/html/bench/qdig/index.php > /dev/null Elapsed time: 3.327445 sec [bigint] $ sapi/cgi/php-cgi -T 1000 /var/www/html/bench/qdig/index.php > /dev/null Elapsed time: 3.382823 sec It would be great to measure the difference on wordpress, drupal, ZF... Thanks. Dmitry. On Thu, Oct 23, 2014 at 2:32 PM, Andrea Faulds wrote: > > > On 22 Oct 2014, at 21:12, Andrea Faulds wrote: > > > > I ran the script several times, then took the results and put them into > Excel to produce the above table with its averages. > > > > So common scripts are either unaffected, or will run ever-so-slightly > faster. > > Just to be clear, though, that didn=E2=80=99t tell the whole story. With = that > number of iterations, there=E2=80=99s no speed difference that isn=E2=80= =99t within the > margin of error. However, up the iterations by 100x and the bigint branch > is consistently very slightly slower. Remove the body of the loop so it= =E2=80=99s > just `for ($i =3D 0; $i < 100000000; $i++) {}` and the bigint branch is > consistently very slightly faster. No idea why either of these is the cas= e. > > So, apparently, the bigint branch both makes things slower and makes them > faster! But it=E2=80=99s not a big enough difference for me to be worried= about it. > The differences that do exist might disappear if the fast_* functions can > have their inline asm rewritten and be uncommented. Currently, master has > custom asm for these, while the bigint branch has to use the probably > slower C implementations because I don=E2=80=99t understand x86 or x64 as= m and am > unable to rewrite it. > > -- > Andrea Faulds > http://ajf.me/ > > > > > --001a11352f46c58bce050616785c--