How Lumen Is Benchmarked

I’ve received a few tweets asking me to demonstrate how Lumen is benchmarked against Silex and Slim.

First, I should state that all of these frameworks are faster than you will ever need out of the box. Keep in mind that even full-stack Laravel 5.0 powers sites that receive 15,000,000 unique visits per day.

The benchmarks themselves are actually really simple. I use a Homestead VM since that is something anyone can recreate. In my tests, I allocated 2GB of RAM to the machine. Of course, benchmark numbers are going to vary depending on the hardware of your host machine. I personally am running benchmarks on a 2012 Macbook Pro Retina 15″ with 16GB of RAM. So, don’t be surprised if your numbers are different than my numbers.

So, to get started, clone down a copy of each project. I used Slim 3, which is the develop branch of the Slim repository since it is close to release and utilizes the new PSR-7 standard for HTTP. It should be noted that Slim 3 benchmarks a bit slower than Slim 2. In my tests, Slim 2 and Lumen are fairly close, with Slim 2 averaging around 1700-1800 requests per second and Lumen averaging around 1800-1900 requests per second. Slim 3 is a little slower at around 1200-1300 requests per second.

So, once you have the projects cloned down and each of them simply returning “Hello World”, you should run “composer dump-autoload –optimize”. This will make a significant improvement in the performance of these frameworks during the test.

I used the simple “Apache Benchmark” program on Homestead which can be installed via “apt-get install apache2-utils”. Once you have installed Apache Benchmark, you can run the test like so:

ab -t 10 -c 10

This will instruct Apache Benchmark to run for 10 seconds with 10 concurrent requests happening.

You should also consider that benchmark numbers can vary depending on the software running on your computer. All three benchmarks in my test video run slower than advertised on the Lumen homepage probably because I am recording video, sound, etc. You will see some improvement in numbers if all other software is closed and your host machine is basically idle.

For the tests in my video the results were

Silex: 950 requests per second

Slim: 1250 requests per second

Lumen: 1700 requests per second

All of these frameworks are ridiculously fast.

Thought Police

Programmers are an interesting bunch – brimming with passion and pride in the shadows of our mansions. They’re beautiful, our mansions of bits and bytes. But, do you know what gets us worked up? The neighbor’s yard – and their kids… Lord knows they need a tutor.¬†They probably don’t even code to an interface. Gross. I mean, it’s dangerous.

It works both ways, right? I’m practical. Those bookworms that won’t stop blathering about the latest architecture or pattern… Just build something already! Stop wasting your time with useless programming trivia and just write some code!

Programmers love policing each other. Heck, humans loves policing each other. We love telling others what to think, what to love, what to hate. We say it all the time, don’t we?

“I mean, they are nice people, but they aren’t like us, you know?”

I’m guilty. How do we stop being judgmental weirdos and start loving people?

Starting Positive

In the past, fishermen have used the color of the morning sky to predict if the day’s weather will be suitable for sailing. Like the fishermen, I’ve found that the day’s beginnings paint a preview of its course. Start positive, and it’s easier to ride the good vibes for the rest of the day.

I asked the Twitterverse how they start the day. Here are a few common responses:

  • Coffee.
  • Exercise.
  • Meditation.
  • Reading A Religious Text.
  • A Good Breakfast.
  • Watching Funny YouTube Videos With Co-Workers.
  • Listening To Relaxing Music.

For me, I’ve found meditation / silence helpful. It’s a time to gather my thoughts and take some deep breaths. Once my mind is clear, it’s easier to approach the day with a positive attitude!

PHP Developers Who Have Inspired Me

Tonight I want to write a quick post and mention a few PHP developers who have inspired me lately. I’ll name them and share a few reflections on how they have inspired me over the past few months.

  • Fabien Potencier (@fabpot) – Fabien is the project leader for Symfony. He manages a very large PHP project, and he does it very well. He’s humble and professional. I want to better imitate those characteristics.

  • Ross Tuck (@rosstuck) – Ross spoke at the recent Laracon in Amsterdam. Watch the video at I’ve thought about his talk many times since. He’s incredibly intelligent, thoughtful, and one of the best speakers in the PHP community.

  • Yitzchok Willroth (@coderabbi) – Yitzchok has become somewhat of a personal advisor to me. He gives thoughtful advice, challenges me, and encourages me with his wisdom.

  • Michelle Sanver (@michellesanver) – Michelle showed Dayle and I around Zurich for a few hours, and recently spoke at Laracon EU. She’s quiet, but ridiculously smart. She’s building a really cool project called OmNomHub – it’s like GitHub for recipes.

  • Kayla Daniels & Ed Finkler (@kayladnls – @funkatron) – Both of these talented developers are raising awareness of mental illness, and encouraging those suffering to seek the treatment they need for healing. Mental illness is one of the most debilitating diseases on the planet, and I really appreciate the work these developers are doing to combat it.

  • Igor Wiedler (@igorwhiletrue) – Igor is always doing something cool things that twist my brain. He’s very humble, and an all around nice guy. I always enjoy reading over his latest code.

  • Mior Muhammad Zaki (@crynobone) – Mior and I talk about Laravel a lot. He listens to a lot of ideas and helps me sharpen them. He lives on the bleeding edge of Laravel quietly making sure everything is up to snuff – and never complains about anything.

  • Matt Stauffer (@stauffermat) – Matt is a great friend. He gives great technical advice about Laravel. But, more than that, he gives me great life advice.

  • Konstantin Kudryashov (@everzet) – Konstantin is way smarter than me. He recently spoke at Laracon EU and gave me great feedback for improving areas of Laravel 5. One day I want to write code like Konstantin!

Of course, there are so many other awesome PHP developers out there, and so many of you have impacted me in a positive way. Maybe I’ll do one of these posts every month to keep spreading the love!

On Laravel’s Future

This summer marks the third anniversary of Laravel’s release. It has grown very quickly, and I think its future is very bright. In many ways I feel like “the best is yet to come”!

However, as Laravel has grown, it has become more difficult to maintain. With the launch of other “products” such as Forge, Cashier, Envoy, and Homestead, the time commitment required to maintain Laravel has grown substantially. Because of this, most of my time spent on Laravel has simply been managing issues and pull requests on the main Laravel repository. However, a key part of my vision for Laravel is to continue innovating and making it more enjoyable than ever to write robust, powerful, and maintainable applications.

As many of you know, I have spent the last several years working full-time at UserScape, primarily working on building Snappy. For about the past year, UserScape has also graciously allowed me to devote Fridays to Laravel, which has allowed me time to catch up on Github issues and pull requests.

However, I will now be moving to a part-time role at UserScape, and will divide my time evenly between UserScape and Laravel.

This transition means that I will spend every other week fully focused on Laravel, drastically increasing the amount of time I am able to devote to the framework and the surrounding ecosystem. With this change, I will be able to devote more time to Laravel than I ever have in the past, which is incredibly exciting!

In closing, I’m very thankful to Ian Landsman and the UserScape family for their investment in Laravel thus far (both financially and as a friend), and am thankful for this opportunity to continue working on two products I deeply care about!