Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79554 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13270 invoked from network); 11 Dec 2014 06:49:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2014 06:49:52 -0000 Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 209.85.212.175 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:47456] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/E0-05320-E8E39845 for ; Thu, 11 Dec 2014 01:49:50 -0500 Received: by mail-wi0-f175.google.com with SMTP id l15so13539685wiw.14 for ; Wed, 10 Dec 2014 22:49:46 -0800 (PST) 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=AvSVXR5F68rGOsfUK1xX7U+QJa6Sq9cLsd/SopCBv0E=; b=Oa0leU9xhlEh0YtibodDXE9kE0aQaNk1FDVCeWYDFoD3wqa1rQdY8inVCnrEOJgG/6 6AoJUD0Rt160RAsaleR6ytn+R+LelAUlhEiwLclZ1lCzzybjGAk/S1UdPcLq3qtH+ZtF k2bxgha3R0kZQik6ChvQfnCV2JkzwJHcy4iVd2bNeiJQLtPI1b0amrwjgd2XS1jNM92c izWIkE46ShGfv/h7Bqv7yuPMpaql54t+vrZ3ly+BsxO7oT0RTDnhPC7gaKhgt4ODEh0Z eYGEBYInWmSWsqhG8ITN7zM9xi2NUQx3hrzekladHOnKX2U6EOzfZJGu1t314jKJAVvO 3u3A== X-Gm-Message-State: ALoCoQlODgkNTHfcDgol6NNbRDJOyxrpz5kVC8OyOXVU/oaWX632I3jRbQFymbjh/cyi76O9nys/ MIME-Version: 1.0 X-Received: by 10.180.75.199 with SMTP id e7mr12949478wiw.21.1418280586699; Wed, 10 Dec 2014 22:49:46 -0800 (PST) Received: by 10.194.239.98 with HTTP; Wed, 10 Dec 2014 22:49:46 -0800 (PST) X-Originating-IP: [80.123.194.214] In-Reply-To: References: Date: Thu, 11 Dec 2014 07:49:46 +0100 Message-ID: To: Ferenc Kovacs Cc: Julien Pauli , PHP Internals Content-Type: multipart/alternative; boundary=f46d043895778ffaca0509eb2e97 Subject: Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer From: kontakt@beberlei.de (Benjamin Eberlei) --f46d043895778ffaca0509eb2e97 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I updated the RFC to include a paragraph on this. The change should be included as-is and then be part of a potential refactoring, should one happen. On Thu, Dec 4, 2014 at 3:26 PM, Ferenc Kovacs wrote: > > > On Thu, Dec 4, 2014 at 1:17 PM, Julien Pauli wrote: > >> On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs wrote: >> > >> > >> > On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli wrote: >> >> >> >> On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei >> >> wrote: >> >> > Good morning, >> >> > >> >> > This is just a very small change, I propose this RFC for discussion >> to >> >> > turn >> >> > the C function "gc_collect_cycles" into a pointer. >> >> > >> >> > https://wiki.php.net/rfc/gc_fn_pointer >> >> > >> >> > Composer's garbage collection optimization showed that PHP Profiler= s >> >> > fail >> >> > to capture the dynamics of GC and we need better hooks to make this >> >> > possible. >> >> >> >> There are many other things that could be turned into function >> >> pointers to allow extensions to hook. >> >> Our hook strategy should be reviewed entirely. >> >> >> >> Not only GC. If you look at streams, many of them are not >> >> overwritable, and some are, but they are missing from the headers fil= e >> >> so you may not overwrite them. >> >> >> >> I suggest we design a wider RFC for PHP7 about what we would be able >> >> to hook, and what not (and what is the impact, because the more you >> >> hook , the more complex it becomes about bad interactions). >> >> >> >> This may also include a refactoring in the zend_module_entry and the >> >> zend_extension structs. Fe, zend_extension hooks about the op_array >> >> could be reworked , I find the op_array_dtor_handler hook misplaced i= n >> >> the chain. >> >> zend_module_entry could also benefit from refactoring to have a bette= r >> >> knowing of other extensions, and a true dependency manager. >> >> >> > >> > That sounds like a lot of work. >> > +1 if somebody willing to champion that effort, but I wouldn't >> delay/discard >> > this small improvement on the vague promise that maybe this will be >> solved >> > as part of a bigger rfc. >> > just my 2 cents ofc. >> >> Yep, but the problem in adding a new hook is that today its for >> feature A, tomorrow it will be for feature B, etc... >> There is a risk of lack of consistency between all the ideas, that's >> why I myself did not propose any single idea in this way, but prefer >> merging them and propose something more consistent. >> We could benefit from a new major release to have a more global >> hooking strategy. >> Also, as this changes the ABI by publishing a new ZEND_API, we should >> consider adding this in a major and not in a stable release (even >> thought that doesnt break the ABI). >> >> I agree some ideas may represent more work than others (like a >> dependency management system for extensions), however, big part of the >> ideas is just about "what hook to move", "where to", "why" and "what >> hook to add" (and why). >> >> Also, having too many hooks can lead to many problems like extensions >> incompatibility, something barely taken care of in our module API, but >> which should as well be redesigned as it doesn't really work that >> much. >> >> Julien.P >> > > Those are all solid ideas and I wouldn't go against them if proposed, I'm > just a bit afraid that we end up with > http://en.wikipedia.org/wiki/Nirvana_fallacy where we reject small ideas > on the ground of not being perfect or part of a bigger scheme while we > don't have the resources to actually make those bigger schemes a reallity= . > Let see what the others think though. > > -- > Ferenc Kov=C3=A1cs > @Tyr43l - http://tyrael.hu > --f46d043895778ffaca0509eb2e97--