Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64017 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30430 invoked from network); 21 Nov 2012 08:14:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Nov 2012 08:14:38 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain zend.com does not designate 209.85.219.42 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.219.42 mail-oa0-f42.google.com Received: from [209.85.219.42] ([209.85.219.42:33829] helo=mail-oa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/07-20662-C6D8CA05 for ; Wed, 21 Nov 2012 03:14:37 -0500 Received: by mail-oa0-f42.google.com with SMTP id j1so7217286oag.29 for ; Wed, 21 Nov 2012 00:14:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=5Fau0XHCLNEGPiSydHfkjtHMorjompA87qGJWtV8RwA=; b=d7DTC/H40ggSfRmMhFV35pAWgMHFNJaarqVCZemFDS75sZCwXmvcjPAgKpDT2RE9FB rxvQKunEUgS+iaz4Y5ZDpwLdB/nn3Ex4CBCEJamOSXCrzPj5bhxeYJlYyLDhBEGpoHRd f4tj07nKAHKbfzMntI2V1PrxQ26r7Z4paMo5fg2EHVfXihPIjF8cq7X3G9q2IPR1+o/V DpGZB+odSnnARVIvXdj3aJ8WZvAtqHKgzWiPx345fgENVcxtgfax6a5VoOsx2m6VpMfG N5khpTVVJOSbmEkZtx8O9Wbd7jC16AKnOoceapCugrhY3fVq6j0EGVOWTJh7TdB6GLKX Wwsg== MIME-Version: 1.0 Received: by 10.182.76.132 with SMTP id k4mr1495663obw.93.1353485672975; Wed, 21 Nov 2012 00:14:32 -0800 (PST) Received: by 10.182.14.234 with HTTP; Wed, 21 Nov 2012 00:14:32 -0800 (PST) In-Reply-To: References: Date: Wed, 21 Nov 2012 11:14:32 +0300 Message-ID: To: Laruence Cc: PHP Internals , PECL Announce Content-Type: multipart/alternative; boundary=f46d04478999bf0c7a04cefcf0a4 X-Gm-Message-State: ALoCoQmODZrEX2nEynCbfwtU0q0N8Hw2UWbLQn/OtaaSeEj3+zE8z7ni0J8yVcmIX+IUnOiCUdjChSrG3j7Q/012S/W0S/gvEBmjHxfa56spBV6WmV7JEZn+r34+PRHXVvGtWSNw29u8 Subject: Re: Expose zend_message_dispatcher_p From: dmitry@zend.com (Dmitry Stogov) --f46d04478999bf0c7a04cefcf0a4 Content-Type: text/plain; charset=ISO-8859-1 Great! I always glad to help. And I would avoid "tricky" solutions as much as possible. :) Even 2 minutes TTL is going to save few thousands syscalls, in case your site is really high loaded, and it make no sense to care about "last syscall optimization" if you system is mostly idle. BTW: I'm not sure if APC calls stat() for inclode_once(), but it definitely possible not to call it. Thanks. Dmitry, On Wed, Nov 21, 2012 at 11:56 AM, Laruence wrote: > 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/ > --f46d04478999bf0c7a04cefcf0a4--