Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

andy's avatar
Level 8

Lumen

Interesting. But why a direct comparison to Silex, or any framework at all?

Does this mean that the work put into Lumen will also mean that Laravel will eventually gain some speed advantages?

0 likes
84 replies
bobbybouwmann's avatar

Lumen is more pointed to API's then complete applications. An API needs to be fast and you don't need the front-end template engine and so on. Lumen is just that :)

Lumen is a stripped version of Laravel since you can upgrade Lumen to Laravel if you want to

Have a Lumen project you want to upgrade to the full Laravel framework? It couldn't be easier. Since Lumen is powered by Laravel's components, just drop your code into a Laravel installation. You won't have to change a thing.

bashy's avatar

Main site - Laravel

API linked to same database - Lumen

7 likes
davorminchorov's avatar

I am looking for a comparison table of the components and features of both Laravel and Lumen. Does anyone know the differences?

pmall's avatar

I read the documentation quickly and it seems its laravel with less features. I must be missing something.

nate.a.johnson's avatar

Less features, less configurable, but way faster and can handle more requests per second because of it. Perfect choice for API projects and a nice complement to Laravel.

gregrobson's avatar

Sometimes you don't need all the features.

At work we use several APIs (Mandrill, Postmark, SMS providers... aiming to add Calq.io soon). You don't really want your inbound/outbound API requests in your main Laravel App. Queuing and dispatching requests and responding to web hooks is all fairly separate (although will probably share a data store). For your (and the API providers) benefit, you should handle requests as quickly as possible.

This seems ideal for separating your application services from your (consumer facing) business application, while retaining the advantages of a common Laravel API :-)

luoshiben's avatar

@pmall What's to be disappointed about? Laravel is an amazing platform for robust applications. This robustness comes at a bit of a speed cost, of course. That being said, Laravel is still pretty fast (and adequate hardware can help alot) and in many cases using the entire Laravel stack is perfectly fine. However, when speed is a hard requirement Lumen seems like a great tool for the job. Using Lumen to create APIs is a perfect example of where this makes sense. You get the benefits of working in a familiar Laravel environment, but some of the features of Laravel that you frankly just don't need for an API are stripped out. Its a beautiful thing.

Since Lumen definitely seems to target APIs, I'd love to see it come with helpers geared towards accomplishing this task. Things like handling proper http responses, transformers, authentication, pagination, etc. Obviously a lot of this can be done out of the box with a bit of work, and generally I like a platform to not be too opinionated, but in this case since the application of Lumen to build APIs is pretty clear it wouldn't be bad to have more tools built in for this. Anyone know if we can still use Fractal (or Larasponse), for example, with Lumen?

davorminchorov's avatar

This Lumen thing seems cool, but I would prefer if there were different types of apps for the Laravel installation.

For example:

  • Without any flags, the normal Laravel installation of the framework is downloaded
  • The flag --api downloads a Laravel installation configured for APIs (no views, sessions etc.)
  • The flag --micro downloads a micro-framework installation with fewer components and features

I know every app is different, but the most important/popular types of web apps would be useful to have as options.

pmall's avatar

@luoshiben Regarding to all the teasing these last day I expected more than a fat-free laravel.

What have been removed that improves performance so much ? There is still router, middleware, controller, eloquent etc... I don't understand what performance bottleneck have been removed.

nate.a.johnson's avatar

I guess it depends on what you were hoping for. This is going to make building react (or angular) based applications very clean. It's a big win for me.

1 like
pmall's avatar

I guess it depends on what you were hoping for. This is going to make building react (or angular) based applications very clean. It's a big win for me.

i don't understand. What can you do now with lumen you couldn't do with laravel ?

HRcc's avatar

That's not the point. Laravel often feels too big when you just need an API for your Angular app. This allows you to have faster 'Laravel'.

1 like
nate.a.johnson's avatar

Nothing new. But lumen is a lightweight, faster version of laravel without all of the stuff I don't need for an SPA.

luoshiben's avatar

@Ruffles Thanks. Was just a bit confused by the statement on the Lumen introduction page that said: "Also, unlike Laravel, Lumen is not intended to be used with additional Laravel "packages" such as debug bars, CMS systems, etc." Not very clear if this means we can't load any 3rd party packages or just that some packages won't work since Lumen !== Laravel.

nate.a.johnson's avatar

Lumen comes with a composer.json file and you can add as much as you like. It's just a PSR-4 application. That said, once you add so much, it might make sense to just use Laravel instead of Lumen. That said again, Fractal seems like an add-on that many Lumen apps will include... I will.

mhopkins321's avatar

I tried to roughly compare the two projects.

lumen new lumen and laravel new laravel and then hit each with a new private browsing session in chrome. Certainly not a pristine testing environment, nor scientific results. But 438ms vs 174ms is a pretty good improvement

Laravel laravel

Lumen lumen

EDIT: for better comparison see this link (or scroll down like...3 posts) for links to blackfire profiling results

3 likes
dberry's avatar

@pmall,

Regarding to all the teasing these last day I expected more than a fat-free laravel.

What?!?! This is huge... I have faced pretty much the same issues that led Taylor to developing Lumen. When i need speed for certain services or a pure API, I have been using Silex. But... In doing so, I had to do things like make the PDO connection, etc or pull in some of the illuminate components, but then I lost some of the speed (i'm not an optimization wiz like Taylor).

Now with Lumen, I won't skip a beat. All of the advantages of a super fast service and the main components of illuminate that I need all right there.

I personally love this more than Forge and Envoyer and just as much as L5. This is a massive and exciting upgrade to micro-frameworks.

I won't be going back through and upgrading my current Silex projects unless they need upgraded, but definitely will be using Lumen for future services that require raw speed.

2 likes
bashy's avatar

@pmall You'd be surprised how slow Laravel actually is but considering it loads so much code into each request made...it deals with it great. Lumen is for "request heavy" or "API" type apps in my eyes.

I'll be using it for an API that will be receiving hundreds of API calls per second. Can't wait!

2 likes
mhopkins321's avatar

How about I do give a slightly more scientific comparison though. Here is the blackfire comparison profile as well as individual profiles for each

The tl;dr of the comparison are the following stats

  • Wall Time: -95% (27.5 ms - 1.35 ms)
  • I/O Time: -98% (6.34 ms - 149 µs)
  • CPU Time: -94% (21.2 ms - 1.2 ms)
  • Memory: -89% (1.95 MB - 219 KB)

EDIT: I'm not sure what sort of things I open myself up to by publically sharing a blackfire profile from a dev machine. So if any of you happen to notice info I probably don't want made public I'd really appreciate a PM. Thanks!

olimorris's avatar

Speed improvements look insane! I personally have no use for this yet but I'll be keeping a very close eye on how and where it's used

andy's avatar
Level 8

IIRC, I remember reading that Taylor was considering something like silex but ended up going full stack. He finally came back to this option. A couple of days ago he hinted at "another framework" so this didn't really come as a surprise. Personally, I was hoping that the #phpdouche guy was correct and this was an application.

As I started off this thread, I'm still wondering why Lumen is being compared to other frameworks? Which scares me since, I am hoping that Lumen does not become a cop out for for addressing speed and memory in Laravel. And, Yes, I do understand and realize that benchmarks and speed are not and should not be used as a comparison to which framework to choose and what not.

I have to admit that I'm more likely to use Lumen than homestead or envoyer. So, thank you!

Rufhausen's avatar

Since Lumen appears to be geared toward things like exposing APIs, I'm a little surprised that it's route groups don't appear to support things like prefixes.

// /api/v1/users
//no workie
$app->group(['prefix' => 'api'], function ($app) {
    
    $app->group(['prefix' => 'v1'], function ($app) {
    
        $app->group(['prefix' => 'users'], function ($app) {
    
            $app->get('/', function () {
                return 'foo';
            });
    
        });
    
    });

});
bart's avatar

Nice to know that Lumen is so much faster. And as @bashy already posted, the main use case will be an API backend system or better a connector between your main Laravel application or any third party application and a persistence layer. In my opinion a damn good idea with tons of possibilities.

Last but not least Lumen lightens up the whole Laravel project ;)

Next

Please or to participate in this conversation.