Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74142 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13272 invoked from network); 13 May 2014 06:05:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 May 2014 06:05:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 209.85.220.178 cause and error) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.178 mail-vc0-f178.google.com Received: from [209.85.220.178] ([209.85.220.178:39596] helo=mail-vc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/11-01992-D16B1735 for ; Tue, 13 May 2014 02:05:18 -0400 Received: by mail-vc0-f178.google.com with SMTP id hq16so7246179vcb.37 for ; Mon, 12 May 2014 23:05:15 -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=ueRZUCopvIFrPbIs7jYokl4IkSPFbYOxkW8kHVdoTKY=; b=ZHhDJjSo5l4xJhQWJKrOF1NCP3Nss+Y0tYRLkskI3qvh0009Nsry9xYvP3vrKN56tQ Ip9lMYYxxW1vMa+nqc9E7QbvR4D/4RhZid8QAPlWg00qAwv3kLo43ByBYJuGi2SDN7zL /1bBDmUEf2dSkcUlMc65KWoovEL+d4T9303vA8h9mqRmXq5kV9E6iw2DDyAkKjW+DusM aTv7SGQr1YGQsx3tocktTT5kvq5em38+ulGi/EJwhHMhMdO43OmMIgO1tsYWGtaAiFmN lSh0bfZM9ZF0ilG5xcwxN7yvJYg4n1dQlusX/jgNRlQtYj+otwivUUHhL/x+Qqvx0tqw 28zA== X-Gm-Message-State: ALoCoQk8GBXADt/huI341yMt+f3eCm60nfZ9F+dN2t7MLqDhzZ5b0t+yP+mPcbSqWvExhEq7J3qZl7j7H9TK17+VlUpVI50CCDfHdUGzoMqwpQwH9JpU9mAYtsjanqAvAguXvrx8sYLC MIME-Version: 1.0 X-Received: by 10.221.26.10 with SMTP id rk10mr27371169vcb.0.1399961114990; Mon, 12 May 2014 23:05:14 -0700 (PDT) Received: by 10.52.111.71 with HTTP; Mon, 12 May 2014 23:05:14 -0700 (PDT) In-Reply-To: <53715F59.6070203@lerdorf.com> References: <5369CED9.5010001@php.net> <4339111475046055305@unknownmsgid> <578A5A21-A820-42AD-A218-FB8049F63B82@zend.com> <3A72C770-9A9F-40C9-9DFE-F40478709BA8@ajf.me> <311084565853739035@unknownmsgid> <536BA9FE.1090408@lerdorf.com> <5370D35C.8000306@lerdorf.com> <53715F59.6070203@lerdorf.com> Date: Tue, 13 May 2014 10:05:14 +0400 Message-ID: To: Rasmus Lerdorf Cc: Zeev Suraski , Andrea Faulds , Andi Gutmans , Sebastian Bergmann , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11339ae4f56fbb04f941d8fb Subject: Re: [PHP-DEV] phpng: Refactored PHP Engine with Big Performance Improvement From: dmitry@zend.com (Dmitry Stogov) --001a11339ae4f56fbb04f941d8fb Content-Type: text/plain; charset=UTF-8 On Tue, May 13, 2014 at 3:55 AM, Rasmus Lerdorf wrote: > On 5/12/14, 12:56 PM, Dmitry Stogov wrote: > > FastCGI (non-PIC) 537 req/sec > > mod_php (non-PIC) 555 req/sec > > mod_pgp (PIC) 463 req/sec > > > > with non-PIC code mod_php is a bit faster than FastCGI (as expected). > > > > PIC makes a big difference on x86. > > I wonder if the difference is as large on x86_64. You tested only on > 32-bit x86, right? > > yes, 64-bit is almost always a bit slower because of bigger memory transfer and more often cache misses. FastCGI (x86_64) 527 req/sec (all the benchmarks were done on the same machine with phpng built from the same sources and with the similar configure options). > Also, even with FastCGI, you are going to be linking in a whole bunch of > PIC shared libraries. So in a realworld app that makes lots of calls > into these libraries you are still going to have jump table function > call overhead. > external functions are not so affected by PIC, because they usually do some significant work and not just addition or comparison of two values, that our VM handlers do. > > Another thought. Since PIC overhead is on function calls and our default > VM is CALL, perhaps using SWITCH or GOTO instead might help here? And if > it does it might make sense to change the default now that the world is > 64-bit and we can't compile non-PIC anymore. > Even in this 64-bit world, I would suggest to try 32-bit PHP. In most cases it shows better performance. X32 ABI would be ideal, but it's not widely supported yet. Anyway, PIC doesn't make significant slowdown on x86_64, because of additional CPU registers and special PIC support. We tried GOTO executor and, of course, it's faster. Actually, after all the optimizations, instruction dispatch overhead became more and more significant, so we will have to think about it. Thanks. Dmitry. > > -Rasmus > > --001a11339ae4f56fbb04f941d8fb--