On 7/13/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote:
On Thu, Jul 13, 2006 at 09:28:00PM +0100, Stephen Deasey wrote:
> Except... Rob found a neat way to cheat by passing the script as an
> arg to a do-nothing 'for' command. 'for' compiles the script for you.
> Very smart and hellish to read...
Ok, some Tcl commands cause their script arguments to be compiled to
bytecode, others simply interpret them directly. And Tcl interps
automatically cache their own bytecode as necessary.
So... Are you saying that Rob changed AOLserver 3.x such that it used
'for' rather than 'eval' (or whatever else) to run the code in *.tcl
files? And THAT made all the difference, because as long as the *.tcl
file had not changed, the Tcl interp would automatically find and use
the bytecode it had already created the first time that particular
*.tcl file was run?
No, it uses eval at runtime. But the object to be evaled already has
it's byte code representation. The byte code is generated as the
object is put into the cache.
But if that's the case, then what does any of this have to do with
per-thread caches? As you said, Naviserver is already cacheing the
string source of *.tcl pages, so what's preventing you from using the
same for/eval trick Rob used, for each interp?
(I must be missing something here...)
Our caches are server-wide, not per-interp. Server-wide caches have
their values stringified.
AOLserver 4.5 has the same restriction with it's new ns_cache
implementation, btw.
We talked about adding per-interp caches. It's not a high priority
for me as I think converting to use the ADP code is the best solution,
for the reasons mentioned before.