I have few thousand users searching my MySQL database few times per day with PHP script. This delivers big load on the server. I heard that encoding my PHP script to base64 will make the proccess faster and will take some load off the server. Isnt that what Zend encoder does?
Thats the question. Is it true or not about base64? 😕

Thank you in advance.

//not encoded:

if ($hi) {
 print "Hello World!";
 }
else {
 print "oops!";
 }
//encoded:

aWYgKCRoaSkgew0KIHByaW50ICJIZWxsbyBXb3JsZCEiOw0KIH0NCmVsc2Ugew0KIHByaW50ICJvb3BzISI7DQogfQ==

    well, that would make it slower since first it would need to be decoded from base 64.
    zend actually turns the php code into byte code, which is an intermediate code between php and actual machine code.
    when you have normal php scripts, every time it is executed, it is first parsed into tokens, and if the syntax is valid, it is all run.
    using the zend encoded will eliminate the first step of parsing the document.
    a feature i hear they want to add in php6 is adding something like what jsp does by saving an intermediate version of a script after its first run.

    edit: forgot to mention, if you dont have the money to fork out for a copy of zend encoder/optimizer, you may wanna look at [man]bcompiler[/man] which will enable you to write your own script to compile php scripts to byte code.

      Write a Reply...