|Newbie questions about Pliant
precompiling http corner code
In addition to precompiling server.pli I'd like to precompile
everything else that is not invoked.
|Message posted by maybe Boris Reitman on 2006/12/01 06:11:59
|This is how I am starting the http server now:
pliant 'precompile /binary/http.dump module /pliant/install/minimal.pli module /pliant/protocol/http/style/default.style module /sites/broadwayflorists/precompile.pli' module /pliant/protocol/http/server.pli command 'http_server port 8080'
When I use w3m or lynx to fetch a page, it is quick. But if I use mozilla
to fetchh the same page right after, it does some crunching for the first time -- I think
that it is compiling the code to generate box corners. How can I arrange to precompile this graphics code too ?
What do I need to put in fullpliant server admin "extra settings" for this to happen ?
I do not understand the pliant compiling mechanism -- does it compile everything
on the fly ? Say if I include a module, does it compile the functions in it,
or only they are invoked for the first time ?
What happens if I put my custom module in precompile "extra settings", and then I change
the module source code. Do I need to delete the default.dump file so that the new version will
get picked up ?
|Message posted by maybe Hubert Tonneau on 2006/12/01 11:04:33
|A .page is compiled the first time a client request it.
Any module invoved in a .page is compiled at the time the .page is compiled
if it was not already compiled.
When a .page changes while the server is running, it is automatically
The modules involved by the .page will not be recompiled.
If you want to precompile some .page, you can try to precompile a standard
.pli module that contains a set of 'http_precompile' instructions.
The last word is: precompiling is a dirty trick, so I never use it on a
production server. If you want to use it, you should first check that your
server is reliable without precompiling, then check that it's reliability
remains the same when precompiling.
As a matter of reliability, when you call 'status' 'memory' administration
page, it scans the memory in order to discover an obvious memory corruption.
|Message posted by maybe Boris Reitman on 2006/12/01 15:01:47
|Are you saying that when I load the page for the first time in w3m,
the code to generate random numbers is not invoked, but when I fetch it from mozilla,
it is invoked because of the round corners ? I mean, is there any code compiled
at the moment that I load a round corner, or is all that code compiled with server.pli ?
My development machine is very slow -- its a transmeta 1gig cpu which is slow.
(i have a tc1000 tablet pc). Thats why I need to do as much precompiling as possible.
When I start fullpliant on my server, I get the prompt "the http server is running on port
8080" fairly quickly. This means that server.pli is alread in the default.dump precompiled binary.
But, when I request a page with w3m, it does quite a bit of compiling.
It seems more than just my code. It probably compiles default.style which is not
included in server.pli. If it is safe to keep server.pli in default dump, why not
default.style too ? What other modules should I add (common.style and common.pli) ?
When I restart the pliant server, I am turning off the apache proxy infront of it,
so that the server will not receive requests until it is "ready", and make it confused.
Is this precaution really necessary, or am I being paranoid ?
Another question related on compilinng that I would like to clarify. If module A
includes modules B and C, and I precompile A, then B and C get precompiled.
So a short script that loads A will start fast using this .dump file.
What about another short script that loads B at the top, but not A -- will
it start fast too using the same .dump file ?
|Message posted by maybe Hubert Tonneau on 2006/12/01 20:47:32
|You can try precompiling default.style .style are standard modules.
About your last question, any module is compiled only once, so B is precompiled
and will not be compiled any more.