Am 13.07.2006 um 23:30 schrieb Stephen Deasey:
On 7/13/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote:
On Thu, Jul 13, 2006 at 10:02:35PM +0100, Stephen Deasey wrote:
Our caches are server-wide, not per-interp. Server-wide caches have
their values stringified.
Must they always though? That is also how the nsv_* commands worked,
but I think Zoran's tsv_* commands do special work to retain the
internal rep of many objects across tsv_set and tsv_get.
Tcl objects may reference other objects. Think of a list. So it's
not enough to copy an object's internal rep, you need to follow the
references and do a deep-copy. That's real ugly because then you need
to know the details of each object's internal rep.
What happens when you come accross an object you don't know about?
Punt, I guess: stringify it.
EXACTLY this is what tsv is doing. For "known" objects it does
a deep copy. It also allows for registering user-callbacks to
process their own objects. But if it encounters object it does
not understand, it stringifies it.
Bytecodes cannot be "magically" processed as they contain
references to literal objects which are stored per-interp
so:
set a 1
The "1" is a literal which gets stored in the per-interp
literal table. Therefore bytecodes must be recompiled when
jumping interpreters. Which is what would hnappen all the
time in our scenario.
Hence I do not hold much about caching bytecodes.
It may or may not be worth while adding per-interp caches to the cache
code, but I'm pretty sure ADP is the way to go for Tcl page caching.
I must second that. With the extension that it may not be worth
adding per-interp/thread caches IMO.
Cheers
Zoran