PHP compiler

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qw12er
    Confirmed User
    • Apr 2004
    • 799

    #1

    PHP compiler

    Is there any good PHP compiler ?

    anybody have any idea of the benchmarks of a compiled PHP script Vs C++ cgi ?
    I have nothing to advertise ... yet.
  • qw12er
    Confirmed User
    • Apr 2004
    • 799

    #2
    I'm looking for something like this ... but it's not ready yet.

    If you?ve ever wondered if it possible to convert a PHP script into an executable program for a specific operating system then you aren?t alone. A number of projects which do just that were announced on the list this week.

    BinaryPHP is a tool than can convert a PHP script to C++ source code that can be compiled with a standard C++ compiler. A ?proof of concept? release is available for download at the web site.

    John Coggeshall has been working on a Zend module tentatively called PASM, the Php AsseMbler. His web site contains some preliminary information about the project, with a download expected to be available sometime soon.






    Link
    I have nothing to advertise ... yet.

    Comment

    • Lane
      Will code for food...
      • Apr 2001
      • 8496

      #3
      If the goal is to hide source code, u should look into PHP encoders. Zend has a good one.

      Comment

      • qw12er
        Confirmed User
        • Apr 2004
        • 799

        #4
        Originally posted by Lane
        If the goal is to hide source code, u should look into PHP encoders. Zend has a good one.

        that ... but mostly execution speed.
        I have nothing to advertise ... yet.

        Comment

        • Lane
          Will code for food...
          • Apr 2001
          • 8496

          #5
          PHP runs in threads. If you make standalone php executables, they will create new processes each time they run, just like cgi. That is more resource consuming.

          Comment

          • qw12er
            Confirmed User
            • Apr 2004
            • 799

            #6
            right, but still C++ is way less resources consuming than PHP... I need to right a cgi that will be called 300 000 times a day. Do you really think it's a option to code it in PHP ?
            I have nothing to advertise ... yet.

            Comment

            • Babaganoosh
              ♥♥♥ Likes Hugs ♥♥♥
              • Nov 2001
              • 15841

              #7
              Originally posted by qw12er
              right, but still C++ is way less resources consuming than PHP... I need to right a cgi that will be called 300 000 times a day. Do you really think it's a option to code it in PHP ?
              Absolutely. 300K times a day is nothing. That only comes out to about 3.5 times a second.
              I like pie.

              Comment

              • qw12er
                Confirmed User
                • Apr 2004
                • 799

                #8
                Originally posted by Armed & Hammered
                Absolutely. 300K times a day is nothing. That only comes out to about 3.5 times a second.
                You're seriously telling me that I could build a whole TGP/MGP in PHP ? Why everybody else do it in c++ ?
                I have nothing to advertise ... yet.

                Comment

                • fuzebox
                  making it rain
                  • Oct 2003
                  • 22352

                  #9
                  Originally posted by qw12er
                  You're seriously telling me that I could build a whole TGP/MGP in PHP ? Why everybody else do it in c++ ?
                  There are several php TGP scripts out there...

                  300k daily is nothing though, there are sites doing well over a million a day powered by php+mysql backends.

                  Comment

                  • Babaganoosh
                    ♥♥♥ Likes Hugs ♥♥♥
                    • Nov 2001
                    • 15841

                    #10
                    Originally posted by qw12er
                    You're seriously telling me that I could build a whole TGP/MGP in PHP ? Why everybody else do it in c++ ?
                    Not many are doing it in C++. Trade scripts are done in C++ because of the sheer number of times the scripts are executed. TGPs have no reason to be in C++. The real load is going to be due to reading and writing from/to a DB. No TGP should ever be dynamically generated every page view. Have the script generate static HTML.
                    I like pie.

                    Comment

                    • qw12er
                      Confirmed User
                      • Apr 2004
                      • 799

                      #11
                      I don't understand ... a compiled application is faster and less resources consuming.

                      but you guys doesn't seems to think so ... I wonder why. (but I value very much your opinion)
                      I have nothing to advertise ... yet.

                      Comment

                      • Babaganoosh
                        ♥♥♥ Likes Hugs ♥♥♥
                        • Nov 2001
                        • 15841

                        #12
                        Originally posted by qw12er
                        I don't understand ... a compiled application is faster and less resources consuming.

                        but you guys doesn't seems to think so ... I wonder why. (but I value very much your opinion)
                        Where did we say it wasn't faster? It really depends on what you're doing. If you're going to be accessing a mysql DB every time the script is executed, writing the script in C++ isn't going to help you much.

                        To say that C++ is always better than PHP wouldn't be right. I love C++ and I loathe PHP but sometimes PHP is better suited to a particular job.
                        I like pie.

                        Comment

                        • RichCashMike
                          Registered User
                          • Jul 2004
                          • 40

                          #13
                          As stated above, a TGP scipt in ANY language should not be generating the entire page from the database on every page view. It should instead generate a static HTML file every time there are changes to it. That being said, if you absolutely need to serve each page dynamically, adding something like the Zend performance suite, or their new product, Canaveral, will help a lot.

                          Comment

                          • Nathan
                            Confirmed User
                            • Jul 2003
                            • 3108

                            #14
                            Just compiling anything so that it is an executable does not make anything faster. If its written shitty its written shitty.

                            I bet a compiled version of PHP is simply the php parsed piggy-backing the script(s) and running them in-memory.

                            Even if it is not that, it still all goes through PHP functions.

                            Learn C if you want to code something as fast as C.
                            "Think about it a little more and you'll agree with me, because you're smart and I'm right."
                            - Charlie Munger

                            Comment

                            • qw12er
                              Confirmed User
                              • Apr 2004
                              • 799

                              #15
                              ok basically I want to do a TGP script (in PHP) that collect A LOT of informations on what my surfers do on my site. I want to monitor everything so I'll be able to send targeted traffic, adjust my sponsors etc.

                              So I want to make everything possible in javascript with cookies to use the surfer computer power as possible. On the onClose event I'll send all the info collected to a script on my server, which should be in C++ (I think, to insert the info in my DB). But I'm not sure of the reliability of such technology (since some ppl disable Javascript and cookies)
                              I have nothing to advertise ... yet.

                              Comment

                              • bret
                                Confirmed User
                                • Aug 2003
                                • 766

                                #16
                                Originally posted by qw12er
                                ok basically I want to do a TGP script (in PHP) that collect A LOT of informations on what my surfers do on my site. I want to monitor everything so I'll be able to send targeted traffic, adjust my sponsors etc.

                                So I want to make everything possible in javascript with cookies to use the surfer computer power as possible. On the onClose event I'll send all the info collected to a script on my server, which should be in C++ (I think, to insert the info in my DB). But I'm not sure of the reliability of such technology (since some ppl disable Javascript and cookies)
                                no offense, but it sounds like you are in way over your head. my suggestion would be to hire a pro to do your back end for you.

                                Comment

                                • bret
                                  Confirmed User
                                  • Aug 2003
                                  • 766

                                  #17
                                  Originally posted by Nathan
                                  Just compiling anything so that it is an executable does not make anything faster. If its written shitty its written shitty.

                                  I bet a compiled version of PHP is simply the php parsed piggy-backing the script(s) and running them in-memory.

                                  Even if it is not that, it still all goes through PHP functions.

                                  Learn C if you want to code something as fast as C.
                                  nathan. a binary will ALWAYS run faster then a parsed script.

                                  with that being said, i agree with you, if it is effiency he is after C/C++ are amoung his few options.

                                  Comment

                                  • - Jesus Christ -
                                    Confirmed User
                                    • Mar 2003
                                    • 7197

                                    #18
                                    Some middle ground.....

                                    http://turck-mmcache.sourceforge.net/index_old.html

                                    Amen

                                    Comment

                                    • Freakster
                                      Confirmed User
                                      • Jul 2002
                                      • 833

                                      #19
                                      Originally posted by qw12er
                                      I'll send all the info collected to a script on my server, which should be in C++ (I think, to insert the info in my DB).
                                      Why C++? The bottleneck will be the DB, not the script itself... I'd make a simple php, zend encode it. Pointless to use c++ in that case, imho.
                                      174-38-56

                                      Comment

                                      • qw12er
                                        Confirmed User
                                        • Apr 2004
                                        • 799

                                        #20
                                        Originally posted by bret
                                        no offense, but it sounds like you are in way over your head. my suggestion would be to hire a pro to do your back end for you.
                                        I have a degree in CS and a Master degree in e-comm ...

                                        Don't worry for me. I'll get thru. It's just that I haven't planned everything yet so some concept are still blury ...

                                        Sorry but it's frustrating that you think I'm overhead with all the qualifications I have ... I know it's not your fault, but still ...
                                        I have nothing to advertise ... yet.

                                        Comment

                                        • Freakster
                                          Confirmed User
                                          • Jul 2002
                                          • 833

                                          #21
                                          des qu'on parle pas anglais parfaitement, ils pensent qu'on ne sait pas de quoi on parle.. ne t'en fait pas.
                                          174-38-56

                                          Comment

                                          • qw12er
                                            Confirmed User
                                            • Apr 2004
                                            • 799

                                            #22
                                            Originally posted by Freakster
                                            des qu'on parle pas anglais parfaitement, ils pensent qu'on ne sait pas de quoi on parle.. ne t'en fait pas.
                                            Yup I know ... but I haven't spoke English for like 4 years now ... so I'm a little bit rusty.
                                            I have nothing to advertise ... yet.

                                            Comment

                                            • rowan
                                              Too lazy to set a custom title
                                              • Mar 2002
                                              • 17393

                                              #23
                                              Sounds like you're working forwards and trying to anticipate everything... why not just work backwards? Try it using plain old PHP, and see if it works. Refine further.

                                              Using javascript and the onClose event will probably be caught by most popup blockers.

                                              As long as you have a dedicated server with decent specs you shouldn't run into load problems. One of mine has about 150k site loads/320k clicks going through a PHP script daily.

                                              12:39PM up 24 days, 11:33, 1 user, load averages: 0.07, 0.14, 0.15

                                              Comment

                                              • qw12er
                                                Confirmed User
                                                • Apr 2004
                                                • 799

                                                #24
                                                Originally posted by rowan
                                                Sounds like you're working forwards and trying to anticipate everything... why not just work backwards? Try it using plain old PHP, and see if it works. Refine further.

                                                Using javascript and the onClose event will probably be caught by most popup blockers.

                                                As long as you have a dedicated server with decent specs you shouldn't run into load problems. One of mine has about 150k site loads/320k clicks going through a PHP script daily.

                                                12:39PM up 24 days, 11:33, 1 user, load averages: 0.07, 0.14, 0.15
                                                Now that's info I can use. But if there were a PHP compilator I could use PHP for everything and compile the part that need optimization.

                                                For the Javascript, that's what I'm afraid off ... but on the other hand I can't use a PHP script each and every time somebody click somewhere...
                                                I have nothing to advertise ... yet.

                                                Comment

                                                • bret
                                                  Confirmed User
                                                  • Aug 2003
                                                  • 766

                                                  #25
                                                  Originally posted by qw12er
                                                  I have a degree in CS and a Master degree in e-comm ...

                                                  Don't worry for me. I'll get thru. It's just that I haven't planned everything yet so some concept are still blury ...

                                                  Sorry but it's frustrating that you think I'm overhead with all the qualifications I have ... I know it's not your fault, but still ...
                                                  where is your CS degree from? the questions you are asking are really basic stuff.

                                                  Comment

                                                  • qw12er
                                                    Confirmed User
                                                    • Apr 2004
                                                    • 799

                                                    #26
                                                    Originally posted by bret
                                                    where is your CS degree from? the questions you are asking are really basic stuff.
                                                    Sherbrooke University Québec, Canada.

                                                    If you think my question are about really basic stuff well you might not have understood correctly what I wrote. Most likely to be me who haven't explain correctly what I meat...
                                                    I have nothing to advertise ... yet.

                                                    Comment

                                                    • rowan
                                                      Too lazy to set a custom title
                                                      • Mar 2002
                                                      • 17393

                                                      #27
                                                      Originally posted by qw12er
                                                      Now that's info I can use. But if there were a PHP compilator I could use PHP for everything and compile the part that need optimization.

                                                      For the Javascript, that's what I'm afraid off ... but on the other hand I can't use a PHP script each and every time somebody click somewhere...
                                                      Why? That's how every second trade script works. On my sites there are actually two scripts running per load, and two scripts running per click. My TGP script is inefficient - it dynamically generates the TGP - but I'm still within the boundaries of acceptable server load. For now.

                                                      If you run into load issues with plain PHP then you can upgrade to Zend, which compiles the script to pseudocode so it doesn't need to be parsed for each load. I believe it also does some other funky tricks like caching. The catch is that it will cost $$$.

                                                      Comment

                                                      • - Jesus Christ -
                                                        Confirmed User
                                                        • Mar 2003
                                                        • 7197

                                                        #28
                                                        Originally posted by rowan
                                                        If you run into load issues with plain PHP then you can upgrade to Zend, which compiles the script to pseudocode so it doesn't need to be parsed for each load. I believe it also does some other funky tricks like caching. The catch is that it will cost $$$.
                                                        Uh... HELLO!!!!!!!!!!

                                                        I guess I'll post it again.

                                                        http://turck-mmcache.sourceforge.net/index_old.html

                                                        free and faster than Zend.

                                                        Amen

                                                        Comment

                                                        • qw12er
                                                          Confirmed User
                                                          • Apr 2004
                                                          • 799

                                                          #29
                                                          Originally posted by rowan
                                                          Why? That's how every second trade script works. On my sites there are actually two scripts running per load, and two scripts running per click. My TGP script is inefficient - it dynamically generates the TGP - but I'm still within the boundaries of acceptable server load. For now.

                                                          If you run into load issues with plain PHP then you can upgrade to Zend, which compiles the script to pseudocode so it doesn't need to be parsed for each load. I believe it also does some other funky tricks like caching. The catch is that it will cost $$$.
                                                          so I should code everything that need optimization in C++ in the first place....?
                                                          I have nothing to advertise ... yet.

                                                          Comment

                                                          • qw12er
                                                            Confirmed User
                                                            • Apr 2004
                                                            • 799

                                                            #30
                                                            Originally posted by - Jesus Christ -
                                                            Uh... HELLO!!!!!!!!!!

                                                            I guess I'll post it again.

                                                            http://turck-mmcache.sourceforge.net/index_old.html

                                                            free and faster than Zend.
                                                            Sorry - Jesus Christ - I missed your post ... My bad

                                                            Look very interresting !
                                                            Thanks a lot
                                                            I have nothing to advertise ... yet.

                                                            Comment

                                                            • AdultSite-Review
                                                              Registered User
                                                              • Jul 2003
                                                              • 81

                                                              #31
                                                              Originally posted by Lane
                                                              If the goal is to hide source code, u should look into PHP encoders. Zend has a good one.

                                                              Sorry Lane, but I must have been living under a rock, or actually just don't use much PHP code. But I was under the assumption that the source code (PHP lines) was NOT readable in a browser?

                                                              Comment

                                                              • FiReC
                                                                Confirmed User
                                                                • Jan 2002
                                                                • 2350

                                                                #32
                                                                Originally posted by AdultSite-Review
                                                                Sorry Lane, but I must have been living under a rock, or actually just don't use much PHP code. But I was under the assumption that the source code (PHP lines) was NOT readable in a browser?
                                                                The code isn't readable by viewing source, however if you are going to distribute the script for others to use on their sites, the source would be readable if you didn't encode it with something like zend.
                                                                www.nubilefilms.com | www.nubiles.net | www.anilos.com | tubescript.nubiles.net | icq4162727

                                                                Comment

                                                                Working...