Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96613 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3733 invoked from network); 26 Oct 2016 11:30:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2016 11:30:52 -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 104.47.41.111 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.41.111 mail-dm3nam03on0111.outbound.protection.outlook.com Received: from [104.47.41.111] ([104.47.41.111:5359] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/59-24108-AE390185 for ; Wed, 26 Oct 2016 07:30:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GRfm11eBk9gKYdtM9B9/GHmXkD60+IODhv+zRTqfdN0=; b=vkeSjIVB5iQ6Ywlt16PfhH0S9I4ew7AynfQQMYhnVSyDyAwCiFdIvmiW5saDXto5/Qqdd2JWWWM2xMDZtuZ7rhc1lE2PiuJbCpk2kd84cNJZSPHUJEez0N/13iAzuTfSJc8unRqKIHxH3V3r6amCIPyhtr1LmjOrTN3xtl/2Zv0= Received: from MWHPR02MB2477.namprd02.prod.outlook.com (10.168.204.147) by MWHPR02MB2509.namprd02.prod.outlook.com (10.168.205.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16; Wed, 26 Oct 2016 11:30:46 +0000 Received: from MWHPR02MB2477.namprd02.prod.outlook.com ([10.168.204.147]) by MWHPR02MB2477.namprd02.prod.outlook.com ([10.168.204.147]) with mapi id 15.01.0659.020; Wed, 26 Oct 2016 11:30:46 +0000 To: Anatol Belski , 'PHP internals list' CC: Zeev Suraski , Xinchen Hui Thread-Topic: [PHP-DEV] JIT for PHP project Thread-Index: AQHSBEck0ew/1MGBGkeGfQZM7o1BKaC65MqAgAAFhro= Date: Wed, 26 Oct 2016 11:30:45 +0000 Message-ID: References: ,<03e001d22f76$af148650$0d3d92f0$@belski.net> In-Reply-To: <03e001d22f76$af148650$0d3d92f0$@belski.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dmitry@zend.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [25.164.163.132] x-ms-office365-filtering-correlation-id: cc1ee6ec-c8ec-4e74-5ddd-08d3fd93877c x-microsoft-exchange-diagnostics: 1;MWHPR02MB2509;6:+JJx4Bw8QxZHvidFbVmvi1+T8JQR/IxQtxgqQ7UI8LP67D5/8rlgWMzce4zYt0Ck6XH1pvnVEqKeNJSGc7sIQzjKEzpAuPo//OsUWae0W4Lnws+4FxcTsV0dP0yTmCLlAEbhh+ahuX2/9mj9zJqS1NZgBPySPWxkqXzCKQIDDreQmPaQ5Qp1mzsn0Pk0Tl6pWnacCU0KgyXMJ3LFmNTctyvmZpdKSHuNzLw/CjQ4ON+udCousqro78m37Jzkg7EoNUc4O0Rrcvd381K0/oDfHqyy3KsBxKUaV4LJbsZ/0TeiPCd/PtxeY83sSfXbOsJB;5:RyAsSowiJ0MG2hivn7Dag8cJl/FWzsoPKMwasQ2HhH9HNfpCjVTwk57UIQJlBFm7N5aXKxymh3PTdAhBLWFaW5U1vazDymJlJaQVPIs3rHMynRTNOqOt6BLZ3EuWoo6PvoJO1BexJso/u0nA0zAURrecf6OU3ksKm0DdMZdId90=;24:Sqw4AmJjHQSGqishjd4OqjSDxC8e6Ug7nBRAkifViFAetbc40vATJAAj+DKXPJyFAJisd5+Rq9QURwl5PZsNedvSOk5xa2H9mA03VJaS6pE=;7:k+43LHAgKROcjl/MMwTrduMqcKwe2EufArBjZ9RECbBkhoR77CKNm2yhgGIZJOfpatZPboSBG163BgAFHKoUEAdydqajZne54OPOmpuLj+ghd2Z40nyjPL+rNG85o9ZlKQttRgUpQW7WESV2t7a49tH5ULQ/9HZig2JF4lSYUIBt/1b7i/HEnUsr7nIKekfIB+Se9FQYIamD8n0e97T/F6HfioyUcshkobQ9XwdPT735gSUpIli3MVrD1NbMekGrza9qIKiK5TlAwvxduD4s2Ht33VAKJRl/DHHfpVKsyRQ7VXJHpysGOS+CafsYoOsNuh3ye2BnepGcZL+SY8+vVG69EFApWqvh7Zks0QK1SPs= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR02MB2509; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(166708455590820); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:MWHPR02MB2509;BCL:0;PCL:0;RULEID:;SRVR:MWHPR02MB2509; x-forefront-prvs: 0107098B6C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(7916002)(51694002)(199003)(377454003)(13464003)(189002)(16236675004)(19617315012)(66066001)(19625215002)(76176999)(50986999)(33656002)(54356999)(3280700002)(3660700001)(99286002)(86362001)(10400500002)(106116001)(105586002)(106356001)(101416001)(2900100001)(5660300001)(15975445007)(77096005)(2950100002)(76576001)(7696004)(122556002)(16799955002)(189998001)(5002640100001)(19580405001)(4001430100002)(107886002)(19580395003)(74316002)(97736004)(8676002)(5001770100001)(586003)(2906002)(3846002)(7736002)(102836003)(11100500001)(7906003)(4326007)(9686002)(7846002)(68736007)(92566002)(6116002)(87936001)(8936002)(81156014)(81166006);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR02MB2509;H:MWHPR02MB2477.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: zend.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_MWHPR02MB24776A05399DF77878753039BFAB0MWHPR02MB2477namp_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Oct 2016 11:30:45.9882 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2509 Subject: Re: [PHP-DEV] JIT for PHP project From: dmitry@zend.com (Dmitry Stogov) --_000_MWHPR02MB24776A05399DF77878753039BFAB0MWHPR02MB2477namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Anatol, The project is in the very early development stage. Now, JIT passes almost all PHPT tests, makes 3 times speed-up on bench.php = and no significant difference on real-life apps (+/-5% depended on opcache.= jit setting. We are hardly working, implementing new ideas... I think it's too early to port this to Windows. Once, we think, we are read= y, I'll ask your help. I suppose we won't need ELF->COFF porting, because we construct ELF objects= just to debug JITed code in GDB and read PHP ELF object for simple symbol = resolution in disassembler (most probably, both won't work on Windows anywa= y). zend_jit_x86.dasc will have to be adopted to support Windows calling conven= tion, of course. Thanks. Dmitry. ________________________________ From: Anatol Belski Sent: Wednesday, October 26, 2016 1:49:49 PM To: Dmitry Stogov; 'PHP internals list' Cc: Zeev Suraski; Xinchen Hui Subject: RE: [PHP-DEV] JIT for PHP project Hi Dmitry, > -----Original Message----- > From: Dmitry Stogov [mailto:dmitry@zend.com] > Sent: Thursday, September 1, 2016 1:57 PM > To: PHP internals list > Cc: Zeev Suraski ; Xinchen Hui > Subject: [PHP-DEV] JIT for PHP project > > Hi @internals, > > I'm glad to say that we have started a new JIT for PHP project and hope t= o > deliver some useful results for the next PHP version (probably 8.0). > We are very early in the process and for now there isn't any real performance > improvement yet. So far we spent just 2 weeks mainly working on JIT > infrastructure for x86/x86_64 Linux (machine code generation, disassembling, > debugging, profiling, etc), and we especially made the JIT code-generator as > minimal and simple as possible. The current state, is going to be used as a > starting point for research of different JIT approaches and their usability for PHP. > > The code is available at: https://github.com/zendtech/php-src/tree/jit- > dynasm/ext/opcache/jit > > The sources may be built and tested as regular PHP (no any special external > dependencies required). > JIT itself is implemented as a part of Opcache. > You may try it in action: > > sapi/cli/php -d opcache.jit_buffer_size=3D32M Zend/bench.php sapi/cli/php= -d > opcache.jit_buffer_size=3D32M -d opcache.jit_debug=3D1 Zend/bench.php 2>&= 1 | > less > > As I mentioned we didn't try to achieve any real performance improvement yet, > although we do currently see 20% speedup on bench.php, but a bit of a > slowdown on real-life apps. > > Wish us luck :) > I just wanted to ask about the status. After starting to do some basic work https://github.com/zendtech/php-src/compare/jit-dynasm...weltling:jit-dynas= m I've stumbled upon a couple of things - in zend_elf.c, the current binary that loads php is being read in, I gues= s this part needs to be ported to parse the Windows COFF format - with DynASM, seems zend_jit_x86.dasc will need to be extended for some compatibility, please correct if I'm wrong Regarding these, maybe you've one or another tip for me? Is this still relevant? Or I jump into it too early? Thanks anatol --_000_MWHPR02MB24776A05399DF77878753039BFAB0MWHPR02MB2477namp_--