Originally posted by riklaunim
View Post
Announcement
Collapse
No announcement yet.
Next-Generation PHP 7.0 Is Running Well But Will It Catch Up To HHVM?
Collapse
X
-
-
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
-
Originally posted by MannerMan View PostI 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.
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
-
Originally posted by bradmccormack View PostInstead 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
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
-
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.
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
-
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
-
Originally posted by clavko View PostWorld 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.
There are not enough good, 'smart' senior experts around to satisfy the demand.
Comment
Comment