Announcement

Collapse
No announcement yet.

Next-Generation PHP 7.0 Is Running Well But Will It Catch Up To HHVM?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by riklaunim View Post
    Switching a company from LANG1 to LANG2 seems like total flush of it IT team as all LANG1 developers have to go and new expert LANG2 developers must come in. If all is done with the same devs and "few trainings" then nothing may help
    I suspect you would get the same benefit or even a superior benefit by rewriting the application in the original language. If you're lucky, a lot of your headaches are just the result of an application that evolved as needs changed. A fresh design may fit current needs better.

    Comment


    • #12
      Instead of rewriting in the same language or rewriting in a new language pull out some profiling tools. Figure out where the bottlenecks are and replace them in order of impact.

      There might be code that is called 100's of thousands of times (tight loops etc) that can be optimised, data structures that can be changed, algorithms that can be replaced or other facets such as adding indexes to your databases that would add orders of magnitude of more speed.

      Its seems pretty crazy to think about rewriting in the same or a new language without doing some sort of diagnostics. (You may have already done so , feel free to ignore)

      If you have analysed everything in appropriate detail and you feel a rewrite is worth it then perhaps rewrite central parts in straight c that can be called from php. I would bet though that your friend the trusty profiler will help you spot some hot spots of crappy performance. Also play with php configuration etc too.

      On top of that you have all sorts of other variables to consider if your application has 100k users such as infrastructure configuration and deployment issues. Can you look at various caching mechanisms such as varnish, memcached / redis etc? Load balancing config (least congested, round robin blah blah)

      p.s Java can produce just as horrible spaghetti like infested technical debt as php in the wrong hands. I have personally dealt with both.

      There would have to be a really good reason for me to switch languages and rewrite something. e.g the above. Do I have access to expert Java devs (within my budgetary allowance - Changing the current php devs to Java won't guarantee any improvements. If anything just a different flavour of spaghetti ). Is php missing something critical such as multi-threading that you require?

      Anyway... my 50c

      Comment


      • #13
        Originally posted by MannerMan View Post
        I think the PHP guys should focus on cleaning up the language rather than speed. I work at a company building a PHP webapplication with around 100k users. We're switching to Java with our new version not because of speed (the whole thing runs on 4 webservers), but rather because of the loose and messy structure of PHP - it leads to many unnecessary bugs.
        Using a framework (like Zend) can help, but can also make things worse. Just look what happened with ZF 2. No backward compatibility, and this is one of areas where Java shines. I actually liked coding in PHP with ZF1, MVC and Smarty, but even then I needed Java for (backend) performance demanding stuff. Just try reading hundreds of thousands of numerical values from excel file, or similar, and then doing some evaluation or calculations (maybe to determine a price) with them with PHP. You could go to lunch, finish your day at work, come home, and maybe than check the result. Calling Java from PHP, letting it do the work, write it to database takes some seconds.

        IMO you did the right thing, provided you have skilled Java developers, or at least capable enough to become good on time. Again IMO it is one of the best backend languages (I am actually speaking about whole env. with JVM, not only lang.) and industry standard for serious business applications at the moment. It is stable, fast, backward compatible, static typing, has best tools like IDEs (IntelliJ, Netbeans), great frameworks (maybe too many of them.),<del> first class database drivers/connectors (Java + Oracle DB make millions of entries per second in telecom kind of companies)</del> Ok sorry, this was stupid. PHP works well with DBMS too. Unrelated (Like everything else I typed. Sorry for hijacking...), I am trying to find time to get some experience with vaadin, which can be a nice tool to knock together nice intranet apps pretty fast.
        Last edited by reCAPTCHA; 04 January 2015, 07:43 PM.

        Comment


        • #14
          Originally posted by bradmccormack View Post
          Instead of rewriting in the same language or rewriting in a new language pull out some profiling tools. Figure out where the bottlenecks are and replace them in order of impact.

          There might be code that is called 100's of thousands of times (tight loops etc) that can be optimised, data structures that can be changed, algorithms that can be replaced or other facets such as adding indexes to your databases that would add orders of magnitude of more speed.

          Its seems pretty crazy to think about rewriting in the same or a new language without doing some sort of diagnostics. (You may have already done so , feel free to ignore)

          If you have analysed everything in appropriate detail and you feel a rewrite is worth it then perhaps rewrite central parts in straight c that can be called from php. I would bet though that your friend the trusty profiler will help you spot some hot spots of crappy performance. Also play with php configuration etc too.

          On top of that you have all sorts of other variables to consider if your application has 100k users such as infrastructure configuration and deployment issues. Can you look at various caching mechanisms such as varnish, memcached / redis etc? Load balancing config (least congested, round robin blah blah)

          p.s Java can produce just as horrible spaghetti like infested technical debt as php in the wrong hands. I have personally dealt with both.

          There would have to be a really good reason for me to switch languages and rewrite something. e.g the above. Do I have access to expert Java devs (within my budgetary allowance - Changing the current php devs to Java won't guarantee any improvements. If anything just a different flavour of spaghetti ). Is php missing something critical such as multi-threading that you require?

          Anyway... my 50c
          I agree with you.

          My suggestion for a rewrite is for when you're dealing with "the loose and messy structure of PHP" (someone else's choice of words, not mine). I suspect the "loose and messy structure" is from the specific project, not an automatic part of PHP itself or of any other particular language, and can be fixed by rewriting the project a bit at a time with a big set of unit tests, system tests, and manual tests to make sure you're not breaking old features as you refactor. I'd still call that a form of rewrite, others might not.

          Comment


          • #15
            Originally posted by michal View Post
            ... if you don't know how to write good tests and properly test your code you are just poor developer and java nor any other language will not help you.
            World is full of poor developers. Actually we make the majority. But we also cost
            much less, and if there's a language that's easy to learn and has features that enables
            us to code in a secure and modular manner, then we'll have it.

            You can't count on good developers, you can count on bad developers. That's why
            there's a project manager and he/she shall do best with resources given.

            Comment


            • #16
              Originally posted by GraysonPeddie View Post
              Does HHVM need to use that much memory for performance?
              Not always. I've run Magento and Drupal web sites on HHVM and got much lower memory usages than PHP-FPM. I now deploy HHVM everywhere I can.

              Comment


              • #17
                My Hopes and dreams for PHP7.
                * Secure by default - even if it breaks some (probably bad) code!
                * performance improvements
                * threadsafe
                * a non pnctl_fork way of multi threading
                * language cleanup with built in migration tool

                listed in order of likeliness

                Comment


                • #18
                  Originally posted by clavko View Post
                  World is full of poor developers. Actually we make the majority. But we also cost
                  much less, and if there's a language that's easy to learn and has features that enables
                  us to code in a secure and modular manner, then we'll have it.

                  You can't count on good developers, you can count on bad developers. That's why
                  there's a project manager and he/she shall do best with resources given.
                  Exactly. Strange how good developers, who also consider them self to be smart, totally ignore the reality, or they really don't perceive it quite well?
                  There are not enough good, 'smart' senior experts around to satisfy the demand.

                  Comment

                  Working...
                  X