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 file modification time
if { $proc0 == "" || [$proc0 1] != $cookie0 } {
set code [ns_fileread $path]
proc filecache_$path {{getcookie 0}} "
if { \$getcookie } { return $cookie0 }
uplevel #$level { $code }
"
}
# Run the proc
filecache_$path
}
Zoran Vasiljevic wrote:
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 excited by this though...
You can't do that, as when you compile:
set a 1
in intrep A and interp B the "1" will result in different literal
object so bytecode rep must be recompiled anyways. Even if you
have one thread and several interps, each time the compiled
bytecode object gets evaluated in the different interp, it gets
recompiled.
Therefore I would suggest people who need last microsecond of
performance to put most of the frequently used code in procedures.
Cheers
Zoran
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/