Live data from Hacker News

PHP Performance Benchmarks

maettig.com

1–10 of 49 posts

Re: PHP Performance Benchmarks

#2
this is interesting, I'd like to see a comparison with foreach vs. for too - just out of curiousity :) Also the $var == "" kind of suprised me, didn't know it was that bad, although I guess this does rarely happen since most probably use empty anyway.

Re: PHP Performance Benchmarks

#3
What am I supposed to learn from these numbers? They are interesting to look at, but I don't have enough information. Exactly what version of php is running, and how is it configured? What does the "Index" field signify? Where can I find the code?

While fun to look at and calculate, it also doesn't mean a lot for most applications. I would argue that data fetching from DBs or caches will be the majority of execution time.

Re: PHP Performance Benchmarks

#6
post #3

What am I supposed to learn from these numbers? They are interesting to look at, but I don't have enough information. Exactly what version of php is running, and how is it configured? What does the "Index" field signify? Where can I find the code? While fun to look at and calculate, it also doesn't mean a lot for most applications. I would argue that data fetching from DBs or caches will be the majority of execution…

>I would argue that data fetching from DBs or caches will be the majority of execution time.

People keep saying that, and I would like to see some numbers for that also.

The DB dataset could be already cached in memory, for example.

Re: PHP Performance Benchmarks

#9

I'd love to see a benchmark of: for ($i = 0; $i vs foreach($users as $user)

There are some similar benchmark here: http://www.phpbench.com/

Intuitively the for loop should be a lot fast as it isn't assigning anything each loop. Although in your example it may be slower because the count($users) would be ran on each iteration of the loop.

Re: PHP Performance Benchmarks

#10
I got excited at first because I thought it was a standalone script that benchmarked a server. Does anybody know of a script that will score a server based on cpu/io/memory/etc? Would be a great way to see if a server is properly configured or what kind of performance to expect from a cloud solution.
Post reply on HN