Performance difference between Hack / HHVM vs PHP / HHVM [closed] - php

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I recently analysed performance differences of two test PHP scripts by running them on various combinations of Apache / NGinx / HHVM / ReactPHP.
My question now is if there is an expected performance difference between a PHP script executed on HHVM and the (as much as possible) identical script implemented in Hack (and executed on HHVM)?
Has anyone tried this?

According to a comment on the HHVM blog, as of April 2014 there is no runtime difference due to the types being erased at runtime.
However, once that changes you should be able to expect a small performance increase, considering that HHVM is optimized for Hack, and that static typing is generally faster than dynamic typing.
And a little bit of background:
HHVM had to be developed from the ground up, and is still relatively new. Facebook's codebase was originally in PHP, and moved to Hack as they had time to recode. They are focusing on improving the runtime as a whole, and this is (comparatively) a very minor area of improvement. The change would only affect Hack, so I expect they will delay that until they are running low on other, larger improvements

Related

Is it bad to use many packages in Laravel? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Sometimes a feature that I want to create for my laravel application already exists as a package.
It is easy to install them, but I am worried about their impact on the application performance.
What should I consider when choosing whether to install a package or develop a feature by myself?
It's personal preference at the end of the day.
Some packages are well written, optimized and maintained and this gives you so many benefits:
Reduced maintainence cost (i.e. you aren't 100% responsible for fixing the package code)
Decreased development time (i.e. you don't have to write it)
Increased functionality (i.e. they may have features you hadn't even thought of)
Other packages are poorly written, un-optimized and in some cases obsolete. These can have the opposite effect:
Increased maintainence cost (i.e. the author isn't neccesarily going to fix an issue)
Increased development time (i.e. you will probably have to learn their code base and fix issues yourself)
My advice would be to make sure that if it's a well respected author/company and their code base is activily being worked on (check github / npm / etc), then using the package will likely save you time and hassle in the long run.
You aren't likely to see any massive performance degredation by using composer packages over writing it yourself!

Difference between pre-configured web servers versus building your own [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
What are the pros and cons of building your own web server, and the difference between building your own versus installing a 'pre-configured' web servers (such as: LAMP, WAMP, XAMPP, and other else). Is there any good benifits of building your own web server?
If you're gonna have your own server, would you rather build it on your own, or just download one from the internet? and Why?
Building your own web-server
Pros:
It will work exactly according to your taste
It will use the technologies of your choice
At the end you will know virtually everything about it, while with other webservers sometimes that is not possible
You will be famous if you implement something fantastic
Cons:
You will have to do a lot of complicated stuff which will delay the start of the task you wanted to work on in the first place
You on your own will not be capable to be even close to other webservers, developed by many programmers. You are one, they are legion
As times are changing, modern techniques will pour up and you will need to do a lot of work to adapt to the changes
Other webservers are free in many cases, while developing your webserver is very expensive: you pay with your sweat and tears
But the most important point is that before you start implementing your webserver try out others. Even if you reach to the conclusion that you want to write your own your experience with other webservers will help you a lot in planning yours.

How to migrate PHP Code between versions 5 - 7 without rewriting or reviewing all the code [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm looking at update codebase I'm working with from PHP5 to PHP7 when PHP7 reaches full release (largely due to the fact the speed gains and the ?? operator could really help our site).
As there are deprecated functions, and some things that are altered between the versions, I'm considering using filemtime on php files before including them to see if I should include functions that will modify php7's behavior to act a bit more like php5 in regards to those files. Although this will work on the existing server, I know various copy methods (some down the pipeline that it will be hard to control) will likely change the modified date as files are copied.
Is there a method for determining which php version a file is written with or compatible with and interpreting them appropriately, or is this hacky and risky solution really my best bet?
On solution I see was inspired while hunting for solutions here: link
In short...
create two different localhost servers
set each localhost to link to a different version of php
write code afterwards that pulls from the old code as if it were pulling from a different server.
steadily migrate files from old to new version of php after initial migration.
As a result, instead of having to migrate the entire codebase, it can be migrated a chunk at a time, without having to do all-or-nothing all-at-once. It also should be more durable than the filemtime solution. The downside is that it makes it harder to immediately integrate old code into new code.
Still interested in better solutions, but at least it's a solution.

App Performance on Raspberry Pi vs multi Xeon core server [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am developing an App on a Raspberry Pi using PHP and mySQL. After couple of weeks of development I have noticed that in some cases the App runs slow and then I try to optimise the code related (e.g. too many loops within loops, or loading of static images dynamically is really slow on RPi). Usually the slow-downs would not be felt at all on a more powerful hardware, but I decided that those slowdowns would be noticeable when the server hardware resources are maxed-out.
The question:
Would the application performance optimisations on a Raspberry Pi allow me to achieve better results on a multi-code multi-socket Xeon server later? e.g. would I be able to reach more hits per second before maxing out the hardware resources when I take this approach by developing my App on a less powerful hardware? Or is it just a waste of time and the performance gains are not worth it?
I am asking this because the architecture of RPi and Xeon is very different and whatever I am doing might be a waste of time. As I do not have a Xeon server at the moment, I am not able to compare and prove my point above at all. :)
Thank you!
It depends upon what type of optimizations you are doing. Portability across different hardware all comes down to the architectural independences of the abstractions you are using (e.g. language, compiler, libraries). My understanding of PHP is that it works at a very high level as an interpreter intended to be as portable as possible. So it is already abstracted from the hardware.
My guess is that your optimizations will carry across to the Xeon. I figure you're doing algorithmic and code optimizations, such as researching better methods of doing something, replacing loops with more efficient code, using better data structures, and getting rid of unnecessary and redundant calls. All that will help on any machine.

HHVM in a production environment [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
We are building a new PHP project, and we heard of the new HHVM, we wanted to deploy our application on it, but we are not sure if it is ready for production environments or not?
We have a laravel 4 application with MySQL and MongoDB as the databases.
Our application is concerned alot about performance and speed of requests because it is a financial application.
Is HHVM production ready ? if it is not and we should wait, how easy will it be to migrate to it after we are live when it becomes production ready, will it break our code? and most of all will PHP be on HHVM for a good while after hack is in town ? is there any live examples of it (other than FB)?, We really like HHVMs performance, but we can't risk the whole project goin down after production.
I do not risk moving my current project to it yet, but I plan to enable CI-tests using HHVM (parallel to usual PHP-5.5 tests) really soon. This way I will know when the project is compatible and plan transition
My opinion:
I simply don't trust such a new one (Hack) and can't risk until it's become available or accepted by the community. It's not sure whether it'll gain trust or not. You are going to reduce the support for your project if you need any during the development, not enough resources and fellow developers, AFAIK.
I think, It's risky and you should think again about it. An article about Hack.

Categories