Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88692 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13722 invoked from network); 6 Oct 2015 07:54:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Oct 2015 07:54:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.48 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.48 mail-vk0-f48.google.com Received: from [209.85.213.48] ([209.85.213.48:36455] helo=mail-vk0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/34-05723-C2E73165 for ; Tue, 06 Oct 2015 03:54:21 -0400 Received: by vkfp126 with SMTP id p126so112095049vkf.3 for ; Tue, 06 Oct 2015 00:54:18 -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:date :message-id:subject:from:to:cc:content-type; bh=5XTuC0oeCC+f4+CKAr4DtE7iC7WNDr7U1vmPZoH+2KA=; b=kucJv/0qU8EyXfFz0hMdMGHZx5Ib0yNrTa+szSIbmdfNVBVcwLMc1ubywY7zS2hw78 ioglO/+Rpx4mE8yPlSWKgUOBMH5Eq7jF4YBqoD0XSJAjnVNcKWBJUKwpnprWuNp6YiVo xZV1RX8zjpA6ko/zAloBYgJOcvoQZby3fzqwaDNUVJzXSVpI9Qk496x2tK61aJC+ZUmW 01KE7/pZlMp2l9CvEwAT4cEpEVfN+dOW07Fnwg9TiACqSg589EHaWey1ofEkRAPsxQTK aKgQ0QJHr7Nc8wqtMAPs5yG7fzS5K5ILrCP5RhCaqoUYJMoLIr51xO46S1GD/fh/dMgP QgfA== X-Gm-Message-State: ALoCoQnzJLcuQZnbXyjkuqY4CnG0MG75xwFWq+Jd6WtxXRQga7Mvze7KeBDpd4jXqRrBPEMGImhuiwS1IMqDsnEhoSchB9nS1TAENuyh7gvMYSzQehGG9XWWnV0hQz+uDU4faThGbzxwljqVmu3g0NnLIygXIKLh8MjZy1LcpIbsyfp4ikyUqxg= MIME-Version: 1.0 X-Received: by 10.31.168.79 with SMTP id r76mr3750752vke.102.1444118058512; Tue, 06 Oct 2015 00:54:18 -0700 (PDT) Received: by 10.103.24.5 with HTTP; Tue, 6 Oct 2015 00:54:18 -0700 (PDT) In-Reply-To: References: Date: Tue, 6 Oct 2015 10:54:18 +0300 Message-ID: To: Eric Stenson Cc: Matt Ficken , Pierre Joye , Anatoliy Belsky , Laruence , PHP Internals , "dmitry@php.net" Content-Type: multipart/alternative; boundary=001a11415902e453a005216aef14 Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix From: dmitry@zend.com (Dmitry Stogov) --001a11415902e453a005216aef14 Content-Type: text/plain; charset=UTF-8 Hi Eric, On Mon, Oct 5, 2015 at 9:49 PM, Eric Stenson wrote: > >From: Dmitry Stogov [mailto:dmitry@zend.com] > > > >> On Thu, Oct 1, 2015 at 11:54 AM, Matt Ficken > >> wrote: > >> > >>> Pierre Joy wrote: > >>> And what wincache does. It is slower but the request is served. > >> > >> WinCache (file cache) if it can't reattach, creates a new shared mem > >> file > > > > I'm not sure how WinCache works, but opcache already implements most > > necessary functionality. > > Sorry for getting to the party late, but let me clarify what WinCache does: > > 1. For the opcode cache, if WinCache can't map to the same address, it > falls back to using process-local (heap) memory for the opcode arrays. > This is because the elements in the opcode arrays contain absolute > pointers, and we don't want to spend cycles (a) converting all pointers to > offsets when copying opcode arrays into shared memory, and then (b) > converting all offsets back to absolute addresses when copying the opcode > array back out of shared memory. WinCache simply gets the pointer to the > opcode array in shared memory and returns it, unmodified, to the PHP Core > for execution. > Opcache uses the same strategy,. > When WinCache falls back to process-local memory, it does NOT create a > second memory mapped segment, and does not chew additional cross-process > resources. > Opcahce but don't have a fall-back mechanism in case of inability to remap SHM into the same address space > 2. WinCache's file cache does not map to an identical address in all > processes. We simply map it to *any* address (using NULL for the suggested > address to MapViewOfFileEx), and then use relative offsets in the cache > structures for all entries in shared memory. > File-cache in opcache is a second level opcode cache. Instead of SHM (or in addition to SHM) we may store precompiled php scripts on disk. Thanks. Dmitry. > > 3. WinCache's user cache and session cache are similar to the file cache, > and do not have to map to the same address in all processes. Cache entries > use relative offsets to locate cache entries, and the values do not contain > absolute addresses. > > Finally, For PHP7, WinCache has removed its opcode cache. We assume that > Windows consumers of PHP7 will use Zend Opcache for opcode caching. > > > > Thx! > --E. > --001a11415902e453a005216aef14--