Hi,

I was asked by bjori at php dot net to use this mailing list to discuss
PHP bug 42683, which I filed. Here are the bug comments, feel free to
discuss. All I'm interested in, really, is seeing that the technical
specs for APC are documented. Recommendations on how I can get that to
happen are appreciated.

Here are the bug comments to date:

[16 Sep 11:57pm UTC] 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.

[17 Sep 11:05am UTC] [EMAIL PROTECTED]

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).

[17 Sep 4:23pm UTC] tony at tigerheron dot com

> 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?

[19 Sep 9:16pm UTC] [EMAIL PROTECTED]

ok, so not caching all the (compiled) files can be seen like a bug and
I'm sure somebody is working on that. My advise is: don't worry with
that, because the situation will improve over the time.

[19 Sep 10:10pm UTC] tony at tigerheron dot com

Thanks for the reassurance nlopess, but it sounds like you could use a
good APC reference yourself. Then you wouldn't have to guess as to
whether the behavior was a bug or a feature.

I believe there are conditions under which APC will not and cannot cache
the compiled code. Certainly, Rasmus seems to think so and I would think
he would know. I also do not believe he considers it a bug in APC,
although you would have to check with him. Finally, I don't know that
anyone is working on this or intends to work on it.

There are hints throughout the Web about some of the conditions under
which code will be or won't be cached. I'm trying to get these
documented. I'm sure you want PHP to have the best documentation
possible, so I'm puzzled by your resistance and why this bug report
remains WONTFIX.

Because it's in the WONTFIX state, that also means no one else can
comment on it besides you and me, so we're missing out from whatever
wisdom others could contribute to this discussion. Would it be possible
for you to re-open it?

[20 Sep 8:51am UTC] [EMAIL PROTECTED]

Personally I would like to see tutorials, howto and best practices for
each extension in the manual.. :)

Please use our mailing list (phpdoc@lists.php.net) for these kind of
discussions.

-- 
Tony Freixas
Tiger Heron LLC
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
www.tigerheron.com <http://www.tigerheron.com>
begin:vcard
fn:Tony Freixas
n:Freixas;Tony
org:Tiger Heron LLC
adr:;;4306 SE Reedway;Portland;OR;97206;USA
email;internet:[EMAIL PROTECTED]
title:Manager
tel;work:(503) 771-7724
tel;fax:(503) 771-7724
tel;home:(503) 771-7724
x-mozilla-html:TRUE
url:http://www.tigerheron.com
version:2.1
end:vcard

Reply via email to