Forum OpenACS Q&A: Performance gain by TCL byte code?

Collapse
Posted by Hanjo Pepoulis on
Hi,

did someone try to pre-compile all/some of the API or Modules with the TCL bytecode compiler? Did this result in better performance?

Hanjo.

Collapse
Posted by Don Baccus on
This is done automatically and the results are cached by AOLserver, thanks to work done by Rob Mayoff.  Likewise template pages are compiled to Tcl and therefore run quite efficiently after the first visit.
Collapse
Posted by Hanjo Pepoulis on
Hi Don,

is this work from Rob Mayoff included in all AOLservers? Or is this special work for the OpenACS version?

Collapse
Posted by Peter Vessenes on
It works in all the ACS 4.X distribs and remixes that I've seen. A funny is that it seems to compile each of the first five(?) runs, and cycle through them when you request a page, so if you have a bug in the compiled ADP that can vary per page load, you'll get some REALLY confusing behaviour. This happens mostly when you're trying to overload tags in the request processor.

Overall, it's a fantastic feature -- many pages load about 10 times faster once compiled.

Collapse
Posted by Eric Lorenzo on
Peter:

One guess as to why you're seeing the multiple-compile/cycle behavior: AOLserver maintains a seperate TCL interpreter for each thread. Probably these interpreters don't share compiled versions of TCL scripts, so when you hit a script that a particular thread's interpreter hasn't compiled yet, you have to go through compilation again despite the fact that some other thread may have already compiled it. And if the compiled versions vary, the behavior you observe will vary depending on which thread services a particular request.

(Caveat: 10 minutes spent looking over the AOLserver source doesn't give me a definite answer about unshared compiled versions, so I'm not 100% certain on this.)