from Hacker News

Lumen – A micro-framework by Laravel

by ericbarnes on 4/14/15, 2:53 PM with 110 comments

  • by j42 on 4/14/15, 6:42 PM

    As someone who develops/maintains many high-IO requirement PHP microservices (as part of a service-oriented architecture, or, SOA), I'm torn on this one.

    Laravel is one of my favorite frameworks, especially since 5.0 given its noble attempt to adhere to contract-first/interfaced development and many best practices that in some ways prevent the "worst" kinds of code from being written. It's not static typing, but it's a step in the right direction.

    This seems like it's heavily optimized over the Laravel base, and if high speed and concurrency is important enough that you'd choose Lumen, then it seems like you'd still be stopping halfway in a bit of a "if you have a hammer everything seems like a nail" situation. Unless I'm missing something Lumen still requires resources to be bootstrapped on request, and ultimately that (in the context of a framework) will lead to memory leaks in a loosely-typed language; no way around that.

    Also because disk writes will quickly become the bottleneck before your network capacity does, the two most relevant performance enhancements are to use a non-blocking event-loop (with expensive writes deferred to a tick cycle) and to completely avoid any unnecessary per-request bootstrapping--best done with raw PHP and ideally kept simple. This, combined with an optimized TCP configuration and split-per-process nginx LB at the head will give me r/s 10-50x the purported benchmarks. As much as 1000x when introducing intelligent edge-caching rules.

    Is there a situation where this would be the right tool for the job/more ideal than the base framework but not worthy of a "roll-your-own" solution?

    Either way +1 for Taylor Otwell as a developer and the general quality of his code/releases--Laravel is an ambitious project, and as a developer quite enjoyable to work with!

  • by dustinlakin on 4/14/15, 6:37 PM

    PHP frameworks have come a long way, and so has the language. The big thing that stands out, is that three of the best frameworks in the space (Laravel, Symfony and Slim) work together and feel a friendly/healthy sense of competition. They are reusing each others components and building a much more promising future for PHP.
  • by hising on 4/14/15, 3:38 PM

    Looks nice, I really like Slim Framework, this looks a lot like Slim from what I could tell. Gonna be interesting to see how (if at all) this will effect some performance focus from the Slim developers.
  • by bhauer on 4/14/15, 7:01 PM

    I've just created an issue [1] in our FrameworkBenchmarks project to solicit an implementation of our tests on Lumen. If anyone here is willing to contribute such an implementation, it would be greatly appreciated. The promise of performance caught my eye!

    Incidentally, Round 10 is arriving soon.

    [1] https://github.com/TechEmpower/FrameworkBenchmarks/issues/15...

  • by seandavidfisher on 4/14/15, 4:19 PM

    Looks really interesting. PHP may not be the "hip" language to use (although it's getting better), but it's so popular and accessible that disregarding it as a legitimate option for new projects is myopic.
  • by wesray on 4/14/15, 3:33 PM

    The drop in functionality right into the full framework is fantastic. Really like the ability to write API's with much less overhead, which was a factor that came into play for me recently. Nicely done Mr. Otwell.
  • by quaffapint on 4/14/15, 8:38 PM

    For a micro framework, highly recommend FatFreeFramework - You can see in the upcoming benchmarks how incredibly well it performs for a drop-in (non-compiled) framework... http://www.techempower.com/benchmarks/previews/round10/#sect... ...Also I've found it much easier to learn and use than ones like laravel.
  • by fideloper on 4/14/15, 2:56 PM

    Also interested to see what projects use this as a core "micro framework" service or with an SOA architecture. Seems like good flexibility between framework power and lightweight.
  • by Beatus on 4/14/15, 9:00 PM

    I've just created a project with lumen to have a look at it and lumen and all its vendor packages (with --no-dev and without tests) contain 1522 files and 102449 lines of code – according to cloc.

    Am I doing something wrong or why does it call itself a "micro-framework". A newly created Slim project contains 7417 lines of code.

  • by debaserab2 on 4/14/15, 4:12 PM

    Where's the source for the benchmarks that are displayed as the first item on the project page for this?
  • by sergiotapia on 4/14/15, 4:34 PM

    How painless is deploying a Lumen/Laravel application? I used to use PHP back in 2006 and I remember deploying was as easy as pushing a .php file via FTP.

    Has the experience remained the same? PHP was incredibly simple to deploy.

  • by JimmaDaRustla on 4/14/15, 5:50 PM

    They compare it to Slim 3, which isn't completed yet, sitting in a development branch...

    Slim 3 will also be PSR-7 compliant, I don't see anything about that anywhere in these Lumen docs.

  • by 0x0 on 4/14/15, 4:09 PM

    Any thoughts on how this will compare to Silex?
  • by pearjuice on 4/14/15, 4:23 PM

    If Lumen can use all Laravel its components, can't Laravel use Lumen its routing engine or whatever makes it that fast? What's the key difference that Lumen is considered "fast and micro" over a standard Laravel installation?
  • by EGreg on 4/14/15, 8:31 PM

    I'm sure this is great, but can I see some benchmarks?

    I think many frameworks allow you to include the "basic" subset of the framework, without running all the usual Inversion of Control bootstrapping.

  • by evoratec on 4/17/15, 4:32 AM

    Lumen is not micro, is a Slim-Laravel.
  • by ing33k on 4/14/15, 5:01 PM

    glad to see use of symfony/http-kernel and symfony/http-foundation .
  • by adaml_623 on 4/14/15, 9:29 PM

    Really the biggest drawback to PHP is the lower salaries
  • by crazychrome on 4/14/15, 5:34 PM

    looks good, only 7 years late to the game.
  • by pankajdoharey on 4/14/15, 6:24 PM

    What Rails is to Laravel, Sinatra is to lumen. Nothing more than another copycat idea from the ruby/rails world.