Opened 7 years ago

Closed 7 years ago

Last modified 22 months ago

#114 closed enhancement (wontfix)

Store precompiled opcode in filesystem and load at module startup

Reported by: axel Owned by: moo
Priority: minor Milestone: 2.0.0
Component: cacher Version: 2.0.0
Keywords: Preload, Minit, Startup, SPL Cc: asauerhoefer@…
Application: my.nero.com PHP Version: 5.2
Other Exts: SAPI: apache2handler
Probability: Blocked By:
Blocking:

Description

Hi,

today i worked on a prelaod mechanism for php classes. The main idea was to "compile" php classes and store it in filesystem. Than to write a little php extension that "preload's" this files at module startup ( e.g. MINIT ).

So this classes where at the beginning available, nobody must include or require this files.
I read many lines of SPL code and zend manuals. Unfortunately my little extension never worked ( Maybe to low coding skill ).

Now i found your extension and read the wiki. Actual your extension does all i need, almost :)

I wan't to ask you, if you think it is technical possible to implement such a feature?

Im not really sure, if the MINIT function is the right place to execute functions like zend_execute ...

best regards,
axel

Change History (8)

comment:1 Changed 7 years ago by moo

it's doable, but all the pointers have to be fixed. when save to file, pointer is converted to offset, and when load, we do it reverse way.

and some function pointers to .TEXT (if they're meanful for user defined functions, etc) have to be fixed too.

it rely on whether we can fix all the pointers.

comment:2 Changed 7 years ago by moo

btw, did u check bcompiler?

comment:3 Changed 7 years ago by axel

  • pending changed from 1 to 0

Hi,

Yes i checked bcompiler. That was meand with "compile" ;)

Sorry for my bad english.

I try again to explane.

  1. Maybe bcompile ( or not ) php files and store it in file system
  2. Start Apache --> Load PHP Sapi --> Load Module --> MINIT
  3. Minit read files and execute this files

You wrote that many pointer have to be fixed, is there a diffrence if i load the php files in clear text or bcompiled. I mean if i not bcompile the files, it is easier to implement such a feature?

Maybe you have another idea to release my problem?

Thank you very much for your fast anwser.

best regards,
axel

comment:4 Changed 7 years ago by axel

Hi,

today i tested the xcache extension on serveral real machines and vmware. It work's fine without any problems :)

So i will test xcache the next 3 month, if no problems occur we will use this cool extension on our live server :)

best regards,
axel

Can somebody close this ticket?

comment:5 Changed 7 years ago by moo

  • Resolution set to wontfix
  • Status changed from new to closed

i'm afraid that what you need is supported in php.ini already.

auto_prepend_file =
auto_append_file =

comment:6 follow-up: Changed 7 years ago by moo

(more comment comes after i submit in mind...)

your topic was "Store precompiled opcode in filesystem and load at module startup", but let's split/resolve the feature request into

  1. precompile php on filesystem, just like python compile *.py into *.pyo or *.pyc
  2. on module startup

for a. it's doable but need some work, and have to stablize for production ready. but warming up XCache is fast, so i don't think it as urgent nor useful.

for b. i suppose u mean on request startup, which mean u want to force a specified file to be available on every php request, even if the php files does not include it.

comment:7 in reply to: ↑ 6 Changed 7 years ago by axel

Replying to moo:

(more comment comes after i submit in mind...)

your topic was "Store precompiled opcode in filesystem and load at module startup", but let's split/resolve the feature request into

  1. precompile php on filesystem, just like python compile *.py into *.pyo or *.pyc
  2. on module startup

for a. it's doable but need some work, and have to stablize for production ready. but warming up XCache is fast, so i don't think it as urgent nor useful.

for b. i suppose u mean on request startup, which mean u want to force a specified file to be available on every php request, even if the php files does not include it.

Hi,

today i tested xcache and the results where really great on our development server.
I think a preload at request startup is not needed. Xcache do a great job.

I hope that the extension is stable enough for us and we can use it on our live server.

I will report feedback to you :)

best regards,
axel

comment:8 Changed 22 months ago by moo

  • Milestone changed from 2.2.0 to 2.0.0
Note: See TracTickets for help on using tickets.