Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-14 Thread Zoran Vasiljevic
Am 14.07.2006 um 16:04 schrieb Vlad Seryakov: In the nstk module i have generic caching of compiled pages and file.tcl can be modified to perform per-thread .tcl caching of bytecode as well. Yes, this is a trivial, poor-man's cache which is simple and works. Cheers, Zoran

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-14 Thread Vlad Seryakov
In the nstk module i have generic caching of compiled pages and file.tcl can be modified to perform per-thread .tcl caching of bytecode as well. proc ns_sourcefile { path } { set proc0 [info procs filecache_$path] set cookie0 $stat(mtime):$stat(ctime):$stat(ino):$stat(dev) # Verify

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-14 Thread Zoran Vasiljevic
Am 13.07.2006 um 23:40 schrieb Stephen Deasey: I was suggesting that maybe there should be a away around this as in some cases, like ours, we specifically make sure that all interps are identical: we create one master interp at start up and then clone it for each new thread. No one seemed exc

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: Am 13.07.2006 um 23:18 schrieb Vlad Seryakov: > You are right and now i see that Naviserver does not do this right > because our global cache keeps strings only. It looks like waste of > resource now caching file contents only but ns_share

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Zoran Vasiljevic
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? Tha

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread 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 t

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 23:18 schrieb Vlad Seryakov: You are right and now i see that Naviserver does not do this right because our global cache keeps strings only. It looks like waste of resource now caching file contents only but ns_share uses Tcl_Objs internally, so it is possible to use it instead

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 23:15 schrieb Andrew Piskorski: 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. Yes, but only for certain "known" types of Tcl objec

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Vlad Seryakov
You are right and now i see that Naviserver does not do this right because our global cache keeps strings only. It looks like waste of resource now caching file contents only but ns_share uses Tcl_Objs internally, so it is possible to use it instead maybe? Andrew Piskorski wrote: On Thu, Jul

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
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

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
On Thu, Jul 13, 2006 at 05:08:14PM -0400, Andrew Piskorski wrote: > Which maybe answers my question... I suspect that: Doh, never mind my silly speculations, Stephen just explained now it really works in his last post. -- Andrew Piskorski <[EMAIL PROTECTED]> http://www.piskorski.com/

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
On Thu, Jul 13, 2006 at 04:53:51PM -0400, Andrew Piskorski 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 a

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 22:53 schrieb Andrew Piskorski: Right, output caching is a different thing. But wouldn't it be cool to have it working for ADP pages, Tcl pages, registered procs etc.? Yes, indeed it would... Do not forget that you get caching for free if you just move bulk of the code i

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
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

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
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

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Thu, Jul 13, 2006 at 08:44:17PM +0100, Stephen Deasey wrote: > Byte code can only be cached per-interp and our caches are > server-wide. Currently, it's just caching the read of the Tcl source > from disk. I thought the way Rob Mayoff'

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
On Thu, Jul 13, 2006 at 08:44:17PM +0100, Stephen Deasey wrote: > Byte code can only be cached per-interp and our caches are > server-wide. Currently, it's just caching the read of the Tcl source > from disk. I thought the way Rob Mayoff's original feature worked was that it "compiled" *.tcl pag

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote: This is from file.tcl, # And here's the magic part. We're using "for" here to translate the # text source file into bytecode, which will be associated with the # Tcl_Obj we just cached (as its internal representation). "eval"

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Vlad Seryakov
This is from file.tcl, # And here's the magic part. We're using "for" here to translate the # text source file into bytecode, which will be associated with the # Tcl_Obj we just cached (as its internal representation). "eval" # doesn't do this as the eval provided in Tcl uses the

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote: I meant .tcl file cacheing, which is in tcl/file.tcl when enabletclpages=on then all requests to .tcl are cached in global cache. Right, the Tcl is read from disk and cached in memory. But only the Tcl *source*. It needs to be byte code com

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Vlad Seryakov
I meant .tcl file cacheing, which is in tcl/file.tcl when enabletclpages=on then all requests to .tcl are cached in global cache. Stephen Deasey wrote: On 7/12/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Wed, Jul 12, 2006 at 04:03:37PM -0400, Vlad Seryakov wrote: Naviserver does it aut

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/12/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Wed, Jul 12, 2006 at 04:03:37PM -0400, Vlad Seryakov wrote: > Naviserver does it automatically, it was ported a long time ago Awesome, that's good to know. It doesn't actually... Byte code can only be cached per-interp and our caches

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-12 Thread Andrew Piskorski
On Wed, Jul 12, 2006 at 04:03:37PM -0400, Vlad Seryakov wrote: > Naviserver does it automatically, it was ported a long time ago Awesome, that's good to know. > > Cache compiled Tcl page bytecode > > > > https://sourceforge.net/tracker/?func=detail&aid=689515&group_id=3152&atid=353152 -- A

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-12 Thread Vlad Seryakov
Naviserver does it automatically, it was ported a long time ago Andrew Piskorski wrote: On Wed, Jul 12, 2006 at 03:00:17PM -0400, Mike wrote: Subject: [naviserver-devel] Questions about NS details... (scalability, lib changes) Does there exist a caching mechanism for dynamically generated t

[naviserver-devel] Cache compiled Tcl page bytecode

2006-07-12 Thread Andrew Piskorski
On Wed, Jul 12, 2006 at 03:00:17PM -0400, Mike wrote: > Subject: [naviserver-devel] Questions about NS details... (scalability, lib > changes) > Does there exist a caching mechanism for dynamically generated tcl/adp > pages? If it does, where can I find docs for how it works/when the > cache is