Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92481 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9394 invoked from network); 19 Apr 2016 18:21:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Apr 2016 18:21:34 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:44376] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/B3-22821-D2776175 for ; Tue, 19 Apr 2016 14:21:33 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 7DE9847600; Tue, 19 Apr 2016 20:21:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-46-244-188-236.dynamic.mnet-online.de [46.244.188.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id C336E475FC; Tue, 19 Apr 2016 20:21:29 +0200 (CEST) Message-ID: <1461090086.15523.48.camel@kuechenschabe> To: Lin Yo-An Cc: =?ISO-8859-1?Q?Fran=E7ois?= Laupretre , "internals@lists.php.net" Date: Tue, 19 Apr 2016 20:21:26 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-Jz8PJehKRKCq1ZleC5aK" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Subject: Re: [PHP-DEV] Proposal: Startup snapshot for optimizing app load time From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) --=-Jz8PJehKRKCq1ZleC5aK Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2016-04-19 at 23:59 +0800, Lin Yo-An wrote: >=20 > Yes! not all global variables will be snapshotted, for now I think > EG, SPL_G (which saves the autoloader instances), and some object > instances and zval. Then these opcode could be skipped a lot. So this > looks like something on top of opcache. This calls for quite some trouble. On the internal level one has to mind that we use raw pointers for most things and depend on the zend allocator to clean up memory forcefully on request end. Tracking this safely is quite some work.. Just think about the different memory areas touched by this code: bootstrap.php: c =3D ".= (++$count).";}}"); } } $al =3D new AutoLoader(); spl_autoload_register([$al, 'load']); $foo =3D new Foo(); $bar =3D new Bar(); ?> main.php c.$bar->c.$baz->c; ?> On the individual function level you have to be careful about side-effects. What should happen if session_start() or srand(), just to mention two very different functions with side-effects,are called from the bootstrap code. I believe this is a massive project which requires refactoring for all internal data structure and review for internal functions to mark them as bootstrap-safe, or not.. johannes --=-Jz8PJehKRKCq1ZleC5aK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJXFncnAAoJEH3sTmn8nIPX+EYIAJmOPwnZ6zH/F+Ax4Q8dXYXL qXj3YM4EQXgVtbhJWpyQq/yn5Z9vYFgfyIZCy+5ZlZRRFkpxWE4aqeKI3ogANpsy lCIE+uXI+ySV/Qx3U+8+k57Oi25KDWCgF1Ub4OxY3/YvzWkUK9kqrN73TfNsmlIy FHgPc6WbtBaSvh70n0QNzJgVYmK6PT0hSkPHqj8RZy3NxWDP7TbWrQNYjf8QOWT2 0ZTCRNB9quwfZ60z0a2aT0xCN65vt5geBjpvcUdZPI5507i59pK6G4Yk5XNRQ8Wj DAX2ZWDYRNZe4ZsU+j207TkRuyKcZ1mVmKUFeS2Bhon5iXicteeoj7UFQK8XJlU= =vYrN -----END PGP SIGNATURE----- --=-Jz8PJehKRKCq1ZleC5aK--