php - Is it possible not to load the bootstrapping mechanism at every call? -


this not php question, expertise php frameworks.


a lot of frameworks have bootstrapping (loading of classes , files) mechanism. (drupal, zend framework name few)

everytime make request, complete bootloading process needs repeated. , can optimized using apc automatically caching intermediate code

the general question is:

for language, there way not load complete bootstrapping process? there way of "caching" state (or starting at) @ end of bootstraping process not load again? (maybe answer in other language/framework/pattern)

it looks me extremely inefficient.

in general, it's quite possible perform bootstrap / init code once per process, instead of having reload every request. in specific case, don't think possible php (but knowledge of php limited). know have seen criticism of php's architecture... fair php, it's not language or framework things way. go detail...

the style of "run every request" came "cgi" scripts (c.f. common gateway interface), programs got executed separate process webserver whenever request came in matching file, , predefined environmental variables set providing meta information. file executable, written in language. since first way came of doing server-side scripting, number of first languages integrate webserver used cgi interface, perl , php among them.

to eliminate inefficiency identified, second method devised, used plugins webserver itself... apache, includes mod_perl perl, , mod_python python (the latter replaced mod_wsgi python). using these plugins, configure server identify program load once per process, requisite initialization, loads it's persistent state memory, , offers single function server call whenever there request. can lead extremely fast frameworks, things such easy database connection pooling.

the other solution devised write web server (usually stripped down) in language required, , use real webserver act proxy complicated requests, while still serving static files directly. route used python (quite via server provided 'paste' project). it's used java, through tomcat webserver. these servers, in turn, offer approximately same interface mentioned in last paragraph.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -