(I've also submitted this to the PHP forum.)
Hi,
I'm setting up a project where speed of execution of scripts/functions is very important. I will initially be writing everything in PHP, and will be caching compiled scripts both on the hard disk and in memory to speed up execution. Much of the code will be re-used in lots of places all over the project, so I was wondering if it was worth re-encoding some of the most used functions in C.
I realise that when compiled, most scripts will end up being pure C anyway (unless you've fiddled with the engine, and have added C++ support or something), so I was wondering if there is any point in re-coding. If a function only uses extensions and other functions that are based on C, then would re-coding the function in C make any speed difference to the execution of the function if it is cached in a compiled state anyway? Does this perhaps depend on the function, which could be written more efficiently in C?
Thanks in advance for any responses.
Hi,
I'm setting up a project where speed of execution of scripts/functions is very important. I will initially be writing everything in PHP, and will be caching compiled scripts both on the hard disk and in memory to speed up execution. Much of the code will be re-used in lots of places all over the project, so I was wondering if it was worth re-encoding some of the most used functions in C.
I realise that when compiled, most scripts will end up being pure C anyway (unless you've fiddled with the engine, and have added C++ support or something), so I was wondering if there is any point in re-coding. If a function only uses extensions and other functions that are based on C, then would re-coding the function in C make any speed difference to the execution of the function if it is cached in a compiled state anyway? Does this perhaps depend on the function, which could be written more efficiently in C?
Thanks in advance for any responses.