Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86829 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19901 invoked from network); 24 Jun 2015 02:42:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2015 02:42:46 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.216.54 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.216.54 mail-vn0-f54.google.com Received: from [209.85.216.54] ([209.85.216.54:37023] helo=mail-vn0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/21-11255-4291A855 for ; Tue, 23 Jun 2015 22:42:45 -0400 Received: by vnbf129 with SMTP id f129so4392831vnb.4 for ; Tue, 23 Jun 2015 19:42:42 -0700 (PDT) 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:from:date :message-id:subject:to:cc:content-type; bh=bgAI5pGEVBDwXTXtJUdfTOCwI67IYxGyFIJN06WtbrA=; b=jl9ubiofAspyTgL0sB1c02QCsMDyfvWzULSpbnTZbxkTk4YZU2e6ntSkIzFlYeshqd FZ42UYZHNab96bQmeAdze9ORUtEy83Kn5l0ayx9WMMCaOLczdHn/kql1hN0/K7utVTKx hz2pbr5PF+rhaadSwsvCFPXigJ77Ui8YkTTmvCDCkjaxGb67zGOT7uwhAPjGoTje5csf TLBntl0NBHLeKk7vgs/VlfCPy+jGLD1Vr8atadxFwCozdo2UL6WijX9ovKB+0oMUMGwy PJugNcDX9sYBmrbc3wI3U319wT6royV7BLMy3RzYpBOPoTsLgOJFB1FEn9etaG0tTFT7 HpFA== X-Gm-Message-State: ALoCoQkxfZfogbCat196ot7JroqXZqD4wtiewya6TT63j3TEaa2QcGh6bqTFYZ3TPOx3RYGfEiCJPefMLF4/2d2FMaXCpbGUJCVlSBorgeONlF1lLqgHKUcpNKFVUAFMyrS2jN/62ONAT0kxptmilccOay49MaQubfdA34g0vfHEspxrTuiACdc= X-Received: by 10.52.3.166 with SMTP id d6mr35061831vdd.69.1435113762241; Tue, 23 Jun 2015 19:42:42 -0700 (PDT) Received: from mail-vn0-f46.google.com (mail-vn0-f46.google.com. [209.85.216.46]) by mx.google.com with ESMTPSA id ml19sm4651178vdb.7.2015.06.23.19.42.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 19:42:42 -0700 (PDT) Received: by vnbf62 with SMTP id f62so4365885vnb.10 for ; Tue, 23 Jun 2015 19:42:41 -0700 (PDT) X-Received: by 10.52.13.166 with SMTP id i6mr35003344vdc.17.1435113761354; Tue, 23 Jun 2015 19:42:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.12.1 with HTTP; Tue, 23 Jun 2015 19:42:22 -0700 (PDT) In-Reply-To: References: Date: Wed, 24 Jun 2015 10:42:22 +0800 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Optimizing php_html_entities() From: laruence@php.net (Xinchen Hui) Hey: On Wed, Jun 24, 2015 at 10:35 AM, Yasuo Ohgaki wrote: > Hi Xinchen, > > On Wed, Jun 24, 2015 at 11:31 AM, Xinchen Hui wrote: >> >> >> >> >> On Wed, Jun 24, 2015 at 8:32 AM, Yasuo Ohgaki wrote: >> > Hi Xinchen, >> > >> > On Tue, Jun 23, 2015 at 11:33 PM, Xinchen Hui wrote: >> >> >> >> But passing an non-string to htmlspecialchars are not common used >> >> cases.. >> >> >> >> "optimize" not common used cases... will bring nothing to us.. >> > >> > >> > The reason why I looked into this in the first place is one of my friend >> > complained about slow htmlspecialchars for relatively large table data. >> > >> > He said more than half of execution time is took by htmlspecialchars >> > because >> > >> > - it escapes numeric values as string >> > - it does not accept array value for to be escaped values >> > >> > 1st is covered by this patch. >> > 2nd issue is covered by this FR. >> > https://bugs.php.net/bug.php?id=69908 >> > >> > So it brings something for us :) >> Then what about strlen(number)? are you also going to change its ZPP >> to accept zval instead of string? > > > No. Only some kind of conversion functions are the subject. > e.g. mb_convert_encoding(), mb_convert_kana(), etc. What I meant is that it's rarely usage(like strlen(number)). we should not care about them too much and break arg info. and for the "age" usage you replied in github, I think the author of such codes should be aware, if it's only number, then instead of htmlespcicalchars($age), he should use echo $age directly... which is more faster. so, I am -1 or this "optimization". thanks > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net -- Xinchen Hui @Laruence http://www.laruence.com/