Newsgroups: php.internals,php.pecl.dev Path: news.php.net Xref: news.php.net php.internals:64012 php.pecl.dev:10001 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19815 invoked from network); 21 Nov 2012 06:35:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Nov 2012 06:35:14 -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.214.170 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:61672] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/15-20662-0267CA05 for ; Wed, 21 Nov 2012 01:35:13 -0500 Received: by mail-ob0-f170.google.com with SMTP id wp18so7099873obc.29 for ; Tue, 20 Nov 2012 22:35:10 -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=lcusPhgbGODh4VYZqXE8vXoJf68sgpF1kKm6Pu2m86s=; b=R+L+4dF0Q/BKuOrRZOJRZSB+VINUAkoDFUdQsaEH9pSP43spaWbncO0/9SjbNJyBX0 SE9aQ4E6/SFzLMZrn/RYpqP8oJ+bCpgJz2PSCsv7yKOwyrNGCHv/dmNUUksUz4ETakNA 1qhooApKpEDG5KEfl7WBqTVKWeCP2ValI09cKETlr/KRPGVUwQGwbWbRFIw929u29VmS Jl/mY2no6UYaTxxMRf+ad8j0DJCvM9ehz00YvuhzI1usQRaNrZ0DUZpWIsnq1DyjnLG0 apC/COvG0UU3mxfrU7ga/Gi4FreBesLrYev4GbKKQ8iFbfl5LsvQVWMElxgb5n2ftXUy RiqQ== MIME-Version: 1.0 Received: by 10.60.31.175 with SMTP id b15mr14888613oei.76.1353479710076; Tue, 20 Nov 2012 22:35:10 -0800 (PST) Received: by 10.182.14.234 with HTTP; Tue, 20 Nov 2012 22:35:09 -0800 (PST) In-Reply-To: References: Date: Wed, 21 Nov 2012 09:35:09 +0300 Message-ID: To: Laruence Cc: PHP Internals , PECL Announce Content-Type: multipart/alternative; boundary=e89a8fb1f8045470a204cefb8d78 X-Gm-Message-State: ALoCoQnbJOWu66W5obYasezOjptLMscKmWRew/KaNvKUW8WRQWZLJ2aKYARPa+b/5bLHc523vog8Pvg2MihC2LiCGB9zXG7lPXNeNcfb0rssrUvPoLtVXf3P0zbEF9/qnQgwzkUh8Uqh Subject: Re: Expose zend_message_dispatcher_p From: dmitry@zend.com (Dmitry Stogov) --e89a8fb1f8045470a204cefb8d78 Content-Type: text/plain; charset=ISO-8859-1 [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. 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/ > --e89a8fb1f8045470a204cefb8d78--