Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98896 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57321 invoked from network); 28 Apr 2017 10:06:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2017 10:06:16 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 74.125.83.45 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 74.125.83.45 mail-pg0-f45.google.com Received: from [74.125.83.45] ([74.125.83.45:33362] helo=mail-pg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/E1-14645-61413095 for ; Fri, 28 Apr 2017 06:06:15 -0400 Received: by mail-pg0-f45.google.com with SMTP id y4so7354422pge.0 for ; Fri, 28 Apr 2017 03:06:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=v8mF/TbXdnn4lCVaxH4f2aq9m7Tmgqx2UXGT3eCg9t8=; b=nSgEAD1PSCFdws/TIiBgMICRYYc5dnirXm9z0F9QdVLqtjCG+j6QEiksaRqRG5CoqY ML/JyA3BAIgt/unsIEL5TOW1wCHboFl0T0czntIwKyALx9OkoayhkiZUCOeatwEKX04t 90C0lWBIFvM/pAT6OgNI6suQaSNEtyyXuFFSfaaZopIJfWfwbt9iwXh6EtR3O/mRN8zp O/XkKx4C/fe2E5BeBN4cD2KaTrn+Zh4uiXEaGNFnpuDz8elSo0wrQSl0vDqKEFOD6Qhy ZwUU/vdewaVZS4862QKE/48GBF9YWXMLt4g9uchER7HKLMslsIenRdAUCH4z4Gd7A2eO mYVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=v8mF/TbXdnn4lCVaxH4f2aq9m7Tmgqx2UXGT3eCg9t8=; b=gxnCfZc4+dchkz61fYqyV0W/67Z3dOB7RzwfpMHwyQu0G2u3Kt+xNwMJbMRl28AR/t E45/MwKYwhYXRmXPOoHBzh3lXMRWXCBQDYLrgSv/6cQ97DB9I1rBqHIdH8R18S45Ffup g05ECWccjKEC18XkjgnJsBTdaD/oNKuY/9mHG3PTXN08ZWFvkHObhgg+TSWR9gwC4Rx6 ABM4HcPQ4Li7fWGWXEnNnWU++weFBK8jpEpSOZ6WncDscFrAVz+gIwyNXPtW/fRz6coE wY3olQfepVaNE0l/UGjUpUHYF83SF21G6+N/w0MRW1uh0MCXV9gpPtzgL3BuZgQTlpRA Nk8g== X-Gm-Message-State: AN3rC/6l2u3EysxnocTS3SCl3Q1gobzGkirUaAEjhgp8cTh3l1CDWI3K PpKQhrpX2iYG9Io0y1bPZubFQ0Nhj71BnzE= X-Received: by 10.84.176.100 with SMTP id u91mr13839578plb.39.1493373970899; Fri, 28 Apr 2017 03:06:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.181.197 with HTTP; Fri, 28 Apr 2017 03:06:10 -0700 (PDT) X-Originating-IP: [81.143.203.71] In-Reply-To: <20170428044910.01fc1d66@eto-mona.office.smartweb.sk> References: <20170427115041.06339340@eto-mona.office.smartweb.sk> <20170428044910.01fc1d66@eto-mona.office.smartweb.sk> Date: Fri, 28 Apr 2017 11:06:10 +0100 Message-ID: To: et.code@ethome.sk Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] concept: further improvement of filter extension, "generalising" filter definitons while adding new callback filter type From: danack@basereality.com (Dan Ackroyd) On 28 April 2017 at 03:49, Martin "eto" Misuth wrote: > would make maintaining such library much easier No. Maintaining stuff in PHP core is much more difficult than maintaining it in userland. 'Maintaining' doesn't just mean fixing bugs, it includes thinking about how any changes to APIs get rolled out to users, while minimising BC problems, and keeping code up-to-date with the PHP engine. These things are much easier to do in userland than they are in PHP core. > It would be immensely valuable to me, if we could have filter extension > just intelligent enough, that it would process all request data > according to template, from each input source in succession, **on it's own**, > **in one go** While I can see that could be useful to you the question, again, is why can't this be done in userland? > Even if I store "form definition" arrays in some memory cache (I tried apcu > and ramdisk), so that their instantiation is relatively quick, If you want data/code to be retrieved very quickly, I'd recommend generating PHP code, and then letting OPCache, cache that code, as well as possibly use a classloader that is a good fit for your use case, like this one: https://github.com/Danack/LowMemoryClassloader/ rather than a generic classloader. It loads classes that are already present in OPCache with zero system calls. > that we are > constantly marshalling and unmarshalling things from definition arrays Well, that sounds like a real problem, but it's really not obvious how your RFC would solve that problem. > I hope you are still here. To be honest, I kind of faded out in the middle, but I'm back now. You might want to consider the phrase "I'm sorry I wrote you such a long letter; I didn't have time to write a short one". This list is distributed to thousands of people. Spending some time editing your email down to a concise one, makes it much more likely to be read. Also, it's disappointing that you wrote so many words, but didn't (imho) actually answer why this needs to be in core rather than a userland library. Even if other people might find it useful, that can be more easily done through distributing userland code i.e. through packagist. If it _really_ can't be done in userland, then possibly writing it as a PECL extension would be a good way to prove that it is a useful thing that other people would want to use, as well as being a good way of iterating the API until it fits everyone's use-cases, rather than hoping to get the API correct on the first version in PHP core. cheers Dan p.s. > I am reminding this is happening on "ouput" side of things, where there is no > reason to burn cycles in generating markup, unless form is completely validated > (for confirmation display). It's hard to know for sure, without seeing your actual code, but this also sounds like a problem that varnish cache, with edge side includes is designed solve.