ashish bansal
ashish bansal

Reputation: 411

what makes Lumen faster than Laravel 5

my Question is that what makes Lumen faster than Laravel 5 when they uses the same modules ?

And what are differences in their routing speed.

Upvotes: 1

Views: 850

Answers (2)

Henk Poley
Henk Poley

Reputation: 828

It is not really (that much) faster, roughly in increasing order:

  • Data updates - 20 INSERTs :: 1,789/1,844 ~= Lumen 3% slower :: 65 responses per core per second.
  • Multiple queries - 20 SELECTs :: 3,449/2,908 ~= 18% faster
  • Fortunes - I believe some queries and some data mangling :: 8,205/5,484 ~50% faster
  • Single query - 1x SELECT :: 9,407/6,023 ~= 56% faster
  • JSON Serialization :: 16,627/8,681 ~= 91% faster ~= 2x throughput
  • Plain text - Sort of static content :: 14,083/7,215 ~= 95% faster ~= 2x throughput

Also sort of in order of less real-world like. Plain text you should serve directly from the webserver, or a CDN. And string serialization is sort of what PHP was built for (why is it that slow?).

You can estimate that the Lumen router, and forgoing Eloquent gives about 2x the throughput.

Side note: compare to notoriously 'slow' web frameworks like Ruby on Rails, which is easier to read. To a first approximation pretty much anything else is (magnitudes) faster. Even 'academical' languages such as Haskell which (can) do a lot of proofing your code actually works as you intend (you can go fully typed PostgreSQL <-> Haskell backend <-> Elm).

Upvotes: 0

Nieck
Nieck

Reputation: 1646

Most likely because they removed many functions and libraries from Laravel.

Lumen is the light version of Laravel which makes the framework faster and smaller.

Upvotes: 5

Related Questions