#42683 [WFx]: Need APC theory-of-operation documentation

From: Date: Mon, 17 Sep 2007 16:23:47 +0000
Subject: #42683 [WFx]: Need APC theory-of-operation documentation
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-15@lists.php.net to get a copy of this message
ID: 42683 User updated by: tony at tigerheron dot com Reported By: tony at tigerheron dot com Status: Wont fix Bug Type: Documentation problem Operating System: ANY PHP Version: Irrelevant New Comment: > the php manual isn't a book for a computer science course. Yes, you are correct in that the PHP manual is not the place for tutorials or a how-to-program guide. I apologize for the awkward phrasing. > If you want to know how a opcode cache works, the php manual is > surely not the best place to look at. First, I am not interested in the general theory of opcode caching. Not all opcode caches work the same way. I want to know how APC works. > Anyway, all code you write in PHP is compiled to opcodes (and it > is not the job of APC to compile the code). Thanks for the clarification. You can understand the confusion, I'm sure, given the low-quality of the APC documentation, the presence of a function called apc_compile_file and the presence of a setting named apc.optimization. But let me rephrase as: When writing code, for example, I don't know under which conditions I may be creating code whose opcodes will not be cached by APC. I'm asking for a precise specification of the APC module, not a tutorial. Recently, a blogger posted a quote from Rasmus about the behavior of APC with regards to __autoload (http://pooteeweet.org/blog/538). This triggered a discussion on PECL-DEV where Rasmus somewhat modified his statement (http://marc.info/?l=pecl-dev&m=116512075914909&w=2) after some speculation from various people about what APC would or wouldn't do. I don't know about the documentation quality goals for PHP, but it should be possible for a reasonably experienced programmer to inspect reference-quality documentation and correctly answer questions about what APC does and doesn't do. The main question that the current documentation doesn't answer is: under what conditions will APC cache a file's opcodes vs. the original file vs. not cache at all. I just read the entire APC manual page (http://www.php.net/manual/en/ref.apc.php) and, while one could guess that APC performs some sort of automatic caching, I couldn't find a single sentence that actually stated this. Perhaps I missed it and you can point it out. This seems like something that should be explicit. I also looked at apc_compile_file. It sounds as though any file can be compiled and cached. But Rasmus says there are conditions under which APC will not cache (http://marc.info/?l=pecl-dev&m=116515671021728&w=2). Can we document those conditions, at least the ones that APC tests for? Previous Comments: ------------------------------------------------------------------------ [2007-09-17 11:05:48] nlopess@php.net the php manual isn't a book for a computer science course. If you want to know how a opcode cache works, the php manual is surelly not the best place to look at. Anyway, all code you write in PHP is compiled to opcodes (and it is not the job of APC to compile the code). ------------------------------------------------------------------------ [2007-09-16 23:57:26] tony at tigerheron dot com Description: ------------ I can't seem to find much information on the theory of operation of opcode caches (such as APC). There is plenty of information on installing and running APC, but little on what does or how it operates. Some hints can be found through Google searches, but not much. When writing code, for example, I don't know under which conditions I may be creating code which will not be compiled to opcodes by APC. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42683&edit=1

« previous php.doc.bugs (#15) next »