Expressive + Swoole vs Node.js + Express.js



Hey Guys,

Been experimenting running Zend Expressive on Swoole. A few weeks ago I ran a comparison of Expressive on Apache / Nginx / and Swoole and posted the results to Slack. What I found was Swoole ran Expressive a lot faster then the others. So Tonight I decided to run some benchmarks with Expressive on Swoole against Node.js + Express.js.

Nothing fancy, just letting each framework serve it’s default index page with absolutely NO optimizations for Node, Express, PHP, or Expressive. Everything is right out of the box.

Here’s the environment I used
2 Medium Instances (one for running the server and one for benchmarking)
Ubuntu 16.04

swoole 2.0.12 stable
Expressive@2.1.0 - Module Install + Zend Service Manager + FastRoute + Zend View


Here’s the results:

Comparison One:

Comparison Two:

My Conclusions:
They seem neck and neck. What’s interesting is the initial warm up of Express.js. That seemed be what hurt the first comparison and why Expressive looks so much faster at first glance. That said, I had to flip Express into production mode to even get it close to PHP + Expressive right out of the box.

At any rate, I hope you enjoyed this post, and remember, these benchmarks are for entertainment purposes only.