Newsgroups: php.internals,php.pecl.dev Path: news.php.net Xref: news.php.net php.internals:64015 php.pecl.dev:10002 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26584 invoked from network); 21 Nov 2012 07:56:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Nov 2012 07:56:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vb0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:55175] helo=mail-vb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/46-20662-7398CA05 for ; Wed, 21 Nov 2012 02:56:39 -0500 Received: by mail-vb0-f42.google.com with SMTP id fs19so3147269vbb.29 for ; Tue, 20 Nov 2012 23:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=/t/fqAdVWdkBrxrbuPjF7fmAmfbIg6FJXzLgIsHV4rQ=; b=ap0a/8oyICoZNFqvEXSxEW6uOuEtyxCJGaczRZTN3SqBVZmnmBpgtLQNAvGLWJpzuZ 0J4yZX9JU2Uc/9vlau/S+GJPLUywXh+9K7wWg3VlsG67xwJ6E3JY+mDIjkqPw2E4Z3xT Jwk0C4/S1Hdw2wbSgz1ViBFJ38tzmJYsLVEKjG67v9jjCU4tFMQWd0Mpe85zxt0ov2Sg EZhXti/9avR9vSZ2q9LZD1CGm4cikU7Pd+Ecb1GJ+fczxmX4JVlfo3to/PX/m6ROFNi2 pa3mLXxZVrv6Ueaspftk8hSA29UkVogga0Hi6VXoaAwPMFP0pVkwVv5nCRC3T4XzxvHm gxfw== Received: by 10.58.162.130 with SMTP id ya2mr25918585veb.2.1353484596377; Tue, 20 Nov 2012 23:56:36 -0800 (PST) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.221.12.8 with HTTP; Tue, 20 Nov 2012 23:56:16 -0800 (PST) In-Reply-To: References: Date: Wed, 21 Nov 2012 15:56:16 +0800 X-Google-Sender-Auth: X9V21RxUN9z87yqkOk38t1p5R6Y Message-ID: To: Dmitry Stogov Cc: PHP Internals , PECL Announce Content-Type: text/plain; charset=UTF-8 Subject: Re: Expose zend_message_dispatcher_p From: laruence@php.net (Laruence) On Wed, Nov 21, 2012 at 2:35 PM, Dmitry Stogov wrote: > [see below] > > On Wed, Nov 21, 2012 at 6:39 AM, Laruence wrote: >> >> Hey: >> >> This problem come out when I was figuring a performance issue of >> Yaf_Loader. >> >> Yaf provides a autoloader like PSR0, when doing a classes >> autoloading. it used to: >> >> 1. stat the file, if file does not exists, return >> 2. zend_compile_file >> >> this is okey when you run yaf without opcode cache. >> >> but when you run yaf with opcode cache, the first stat syscall >> become a little waste. > > > You should just use virtual_realpath() or tsrm_realpath() instead of > stat(). They must utilise realpath cache and avoid stat() calls. Hey: Thanks, Dmitry, actually, I didn't do like that is because by default, realpath cache has 2min ttl. but, after a second think, I think this will be better than my current tricky implementation.. I will try in this way :) thanks > > Thanks. Dmitry. > >> >> since opcode cache always hook the zend_compile_file, and compile >> the file from cache. >> >> so, I changed the autoload to: >> >> 1. zend_compile_file >> 2. if compile failed, then return. >> >> but, zend_compile_file will throw warning if the file doesn't >> exists via zend_message_dispatcher_p >> >> so if zend_message_dispatcher_p is ZEND_API, then I can avoid using >> such mess codes: >> https://github.com/laruence/php-yaf/blob/master/yaf_loader.c#L377 >> >> what do you think? >> >> >> thanks >> -- >> Laruence Xinchen Hui >> http://www.laruence.com/ > > -- Laruence Xinchen Hui http://www.laruence.com/