Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104141 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74407 invoked from network); 4 Feb 2019 22:46:35 -0000 Received: from unknown (HELO mail-it1-f180.google.com) (209.85.166.180) by pb1.pair.com with SMTP; 4 Feb 2019 22:46:35 -0000 Received: by mail-it1-f180.google.com with SMTP id m62so2551566ith.5 for ; Mon, 04 Feb 2019 11:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RnG8qGjb78CPVOi8xBEvvwWqcbfoyvu5fi6OTCdj/yk=; b=OWMcM8beGL0i3DMeX2+f6xPJtNcZOEP1zGzM3yVnKJyYZVCBh5ClPC8KjCJOb7hn1m ozjg8BLwgK8sLF/MTwSVXkQv1OLPkCNYoaObZNUsiuJWa9Ibzi7pfAMQwwWlM/trHffS /WJ2JHxFFFeFuU1IZYkhxg2CxyOxRLFJ1KFfUeiAITUggFqNP+A39ArTHGYWE/ouXGeO Ov1E7hINwM/nls7xVQ5JgIHfPF/UoGWgsj3woe1pS337onAThWHuoLQyxeu0wAwI2D1N JwVOM+KttLKEP3sZeGq5SqvBWtqFq+VTY8OvgXmgF0X0G79qCCb4Bn4q7Hl/+jo2pn7W PjdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RnG8qGjb78CPVOi8xBEvvwWqcbfoyvu5fi6OTCdj/yk=; b=D5yuJZ3iR2afm6B618E7CCEDkW8/IzTBJNGo4peat7tcGNjs1ZASZDLn2hzww+6AIH uNAzHW/VNV+CGKfjvuK3sIKqsTBFCfWUCRt82h5h5XBnC1tH9TjOqWXgq9PM7FhH68YV OW6LVIcEH7rqSN5l6sY7Lo9IHhIaH/BedfbxhQEtx2lQ7kfWlntPiWfJui9I987cSlMQ h4t6doK1i6jcF6g3uOYI3vZ6LSKuBkXH1FmDcysleWeQG6FOr74zSxCvYvwYasRkVqdi 2hU7DRL3HeyLh0UtI7IX4n3RKoh/5azdiFUXj3lEiJzVkmPM8z3GXhrfaImqgXYYS8ZS TWpw== X-Gm-Message-State: AHQUAuZOjoI7DvS4ygw2eSV1hstzh56hkbTnboHCbc0GQ+N/rV2AVMEr EYxJ6wn/lYs7Z4FE812X7mTBOFMdDrPCOD6iB7OPmWgq X-Google-Smtp-Source: AHgI3IZ0zSi9YejqKwCXumxUflU7WR+Wij04lEJAJJ2c0f0CEGuR2hb49wDxNV4AD2W9Th722CMCi0iQA930EHxjTaQ= X-Received: by 2002:a24:de87:: with SMTP id d129mr577036itg.110.1549308452105; Mon, 04 Feb 2019 11:27:32 -0800 (PST) MIME-Version: 1.0 References: <866a9262-4f49-fa20-e9d2-dcf2f4b0d320@zend.com> <6fda2b56-b99d-d383-af4d-24280767096e@zend.com> In-Reply-To: Date: Mon, 4 Feb 2019 20:27:15 +0100 Message-ID: To: Dmitry Stogov Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000ef72de0581167b76" Subject: Re: [PHP-DEV] [RFC] JIT From: nikita.ppv@gmail.com (Nikita Popov) --000000000000ef72de0581167b76 Content-Type: text/plain; charset="UTF-8" On Mon, Feb 4, 2019 at 3:44 PM Nikita Popov wrote: > On Mon, Feb 4, 2019 at 2:26 PM Dmitry Stogov wrote: > >> >> >> On 2/1/19 4:23 PM, Dmitry Stogov wrote: >> > >> > >> > On 2/1/19 3:09 PM, Nikita Popov wrote: >> >> On Thu, Jan 31, 2019 at 10:44 AM Dmitry Stogov > >> > wrote: >> >> >> >> Hi Internals, >> >> >> >> >> >> I'm glad to finally propose including JIT into PHP. >> >> >> >> >> >> https://wiki.php.net/rfc/jit >> >> >> >> >> >> In the current state it may be included both into PHP-8, where we >> >> are going to continue active improvement, and into PHP-7.4, as an >> >> experimental feature. >> >> >> >> >> >> Thanks. Dmitry. >> >> >> >> >> >> I would like to check if the JIT provides an improvement for >> PHP-Parser. >> >> Unfortunately I'm getting a segfault when running the tests. Should be >> >> reproducible with >> >> >> >> git clone git@github.com:nikic/PHP-Parser.git >> >> cd PHP-Parser >> >> composer install >> >> php-jit vendor/bin/phpunit >> >> >> >> I tried to debug this. Unfortunately my gdb doesn't seem to work with >> >> JIT: It hangs when the script starts running, on line >> Zend/zend_gdb.c:84 >> >> in zend_gdb_register_code. I don't know if that's a bug or I need to do >> >> something additional here (I'm using GNU gdb (Ubuntu 8.1-0ubuntu3) >> >> 8.1.0.20180409-git). >> > >> > GDB takes enormous time registering too many JIT-ed functions... >> > It should be possible to catch the name of problematic functions and the >> > JIT only them (using PHPDOC trigger). I'll try to analyze the crash, but >> > most probably, only on next week. >> >> I fixed the problem caused JIT to fail on PHP-Parser tests (it was >> related to changes introduced by typed properties patch). >> >> I'm also going to disable automatic JIT code registration in GDB. >> >> Thanks. Dmitry. >> > > Thanks. I was now able to run a PHP-Parser benchmark, which showed ~1.5x > speedup with default JIT configuration. That's promising :) > Unfortunately I made a mistake here and benchmarked against vanilla PHP without opcache (and more importantly the optimizer in opcache). Here are the correct results (for repeated parsing of a large file): PHP: 3.7s PHP+optimizer: 3.2s PHP+optimizer+JIT: 2.4s So the speedup is ~1.3x rather than ~1.5x, which is still good. I also ran the hello-world.php example of https://github.com/amphp/http-server against wrk -c100 -d30 -t4 and got the following results: PHP: 9950 rps PHP+optimizer: 10750 rps PHP+optimizer+JIT: 11350 rps So in this case the improvement is about 5%. (This is the HTTP 1.1 server, HTTP 2 would also be interesting to try, but needs some more setup.) Nikita --000000000000ef72de0581167b76--