-1

I've an already developed social website like Facebook. This website has been developed using PHPFox v3.0.7 (which is a social networking platform created in PHP).

The website functions are working well, no issues with it. The main, major and serious issue I'm facing with the website is the slow execution speed. For operation it takes too much time and user has to wait for a longer time. This really irritates the user and affecting the performance of a website.

So, I did research on if Facebook can execute at rapid speed in spite of heavy user load and continuous operations why can't my site?

Then I come to know HipHop Virtual Machine (HHVM) which they have developed and implemented in Facebook.

So my question is can I use the same approach of using HipHop Virtual Machine (HHVM) into my social website to increase the website execution speed? If yes, how, where to start, what's the best possible and standard way of doing it? If no then why?

halfer
  • 19,824
  • 17
  • 99
  • 186
PHPLover
  • 1
  • 51
  • 158
  • 311
  • Have you optimized your server/PHP/SQL settings? What are you using for a caching system? – Kyle Jun 08 '15 at 13:40

2 Answers2

3

You're engaging in cargo cult programming.

There's a lot more to Facebook's speed than just HHVM, and a site the size of Facebook has very different challenges than the average site will. You are not Facebook and their solutions (which include building their very own version of PHP called Hack) are not likely to apply to you.

Chances are you'd be much better served by searching for poorly indexed database tables, implementing query and page caching, upgrading your hardware, etc. Using a profiler like Blackfire will help greatly in identifying what's causing your slowdowns.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • I agree with the thrust of what you're getting at here. I do want to point out though that Hack solves a lot of problems that come up when scaling a PHP codebase -- developer efficiency and maintainability problems, not performance problems. This sort of thing can hit at a surprisingly small size (a few developers with a few thousand lines of code), and so Hack is pretty widely applicable. – Josh Watzman Jun 09 '15 at 04:54
  • 1
    @JoshWatzman Agreed, but Hack and HHVM are different things. HHVM can run normal PHP so OP wouldn't be getting any of those benefits. – ceejayoz Jun 09 '15 at 13:21
0

There are a lot of configurations you can do to speed up the execution of php code, or the user experience as a whole.

Have you done any of this? What web server do you use? Have you made any optimization on it, or on PHP configuration? Is the database access fast or is it a bottleneck? Have you checked if this is not a bottleneck due to your server specs? Have you tried to scale the number of servers? What have you tried? There are also caching mechanisms, serving static content through other means, and what not...

I do not mean to tell you that HHVM is worthless, but are you sure this is what is getting the slow times? Will you be spending a lot of time in changing your architecture for nothing?

Miguel Mesquita Alfaiate
  • 2,851
  • 5
  • 30
  • 56