OLD[15/08/2016]: Speed test PHP vs Lumen vs Laravel #10
phpclub
started this conversation in
ZZZ - Archive
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working in the new EmailValidator!, and after developing the EU VAT API, I feel confident to develop it on Laravel Framework.
But before we start… let’s test the speed of the stack.
I used my local computer a 8 cores i7 2ghz 8GB ram 512SSD. Apache2, PHP 7.0.8.
Tested this test with siege 5 times for each and retrieved the highest.
UPDATE: a table to see easier the results 😉
PHP
siege -c 5 -b --time=10s http://test.lo/emailvalidator/[email protected]
Transactions: 1368 hits
Availability: 100.00 %
Elapsed time: 9.00 secs
Data transferred: 0.06 MB
Response time: 0.03 secs
Transaction rate: 152.00 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 4.99
Successful transactions: 1368
Failed transactions: 0
Longest transaction: 5.03
Shortest transaction: 0.00
Code used here.
Lumen
siege -c 5 -b --time=10s http://euvat.lo/api/email/[email protected]
Transactions: 1567 hits
Availability: 100.00 %
Elapsed time: 9.90 secs
Data transferred: 0.06 MB
Response time: 0.03 secs
Transaction rate: 158.28 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 4.99
Successful transactions: 1567
Failed transactions: 0
Longest transaction: 0.30
Shortest transaction: 0.00
Lumen was the fasted in 4/5 tests. Only once reached less than 1368 the highest on plain PHP.
Code used here (I used same project as euvat xD)
Laravel
siege -c 5 -b --time=10s http://mailjagger.lo/api/email/[email protected]
Transactions: 1244 hits
Availability: 100.00 %
Elapsed time: 9.24 secs
Data transferred: 0.05 MB
Response time: 0.04 secs
Transaction rate: 134.63 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 4.96
Successful transactions: 1244
Failed transactions: 0
Longest transaction: 0.17
Shortest transaction: 0.01
Used same code as for lumen before, but full laravel stack.
As we can see Lumen is the fastest (I didn’t expect this at all, and not sure why yet :S) I didn’t use any special cache for the results or similar. What is relevant also is that Laravel is slightly slower than PHP but, I think the difference is so little that there’s no need to worry about it at all.
Bonus: Kohana
Same test in a clean install of Kohana.
sudo siege -c 5 -b --time=10s http://test.lo/emailko/welcome/email/[email protected]
Transactions: 1355 hits
Availability: 100.00 %
Elapsed time: 9.91 secs
Data transferred: 0.06 MB
Response time: 0.04 secs
Transaction rate: 136.73 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 4.98
Successful transactions: 1355
Failed transactions: 0
Longest transaction: 0.23
Shortest transaction: 0.01
Kohana was slightly faster than Laravel in all the tests I did.
Beta Was this translation helpful? Give feedback.
All reactions