Re: Patch for opcode caches
| From: | Dmitry Stogov | Date: | Thu, 20 Mar 2008 12:16:17 +0000 |
| Subject: | Re: Patch for opcode caches | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36219@lists.php.net to get a copy of this message | ||
I hope it must be fixed now.
Dmitry.
Marcus Boerger wrote:
Hello Dmitry, can you please fix your mail client? You are breaking every single thread you reply to. Thx! marcus Monday, March 17, 2008, 9:07:41 AM, you wrote:-----Original Message----- From: Marcus Boerger [mailto:helly@php.net] Sent: Friday, March 14, 2008 8:24 PM To: Stas Malyshev Cc: Dmitry Stogov; Andi Gutmans; phpxcache; internals@lists.php.net Subject: Re: [PHP-DEV] Patch for opcode caches Hello Stanislav, Friday, March 14, 2008, 5:51:49 PM, you wrote:slow down.But that means we are compiling inheritance when a file is loaded form the cache. The goal should be to compiling inheritance when writing to the opcode cache file. All we achieve here is ato warn theIf there isYou can not do that. You do not know that until runtime.something that makes this required than at least we needdeprecatinguser about the slow code. I Think what we need to do is10x faster).class andIt won't be slow. It would be much faster (in some casesThis specific assembly of instructions might be slower insome cases,but the code altogether will be faster. That's the idea ofthe opcodecaches.everything can benamespace use in non main blocks as well as include and require in non main blocks. And if there is no such case thanLemme just think, doing inheritance at compile time before we send the stuff to an opcode cache can be slower then?bound early which is the fast state we should aim for.It's always faster, but with opcode caches we cannot always do it in compile-time, because the parent (in another file) might be changed on next load of children class.How is that possible? After all late binding means we do it at run time. And no matter how much faster we can do it. It will always be slower than doing the same thing only once.We do not need to deprecate anything, and inheritance cannot be boundbefore parent class is known, which in the case of bytecodecache means- not before the file is loaded from the cache. That'sexactly what thispatch enables. It does not change performancecharacteristics of neithercached not non-cached code, it just makes it much simplerand working inall cases.Inheritance cannot be done before the parent class is known. We still need to do the prototype checks even if we assume the class is there and insert a virtual class as parent somehow.Right. This is the reason why we need to delay early binding. But we don't like to delay it to run-time, because it will breake the class creaton order and as result may breake some scripts.Thanks. Dmitry.Best regards, Marcus