Lars - Is a lightweight, fast and extensible zero allocation HTTP router for Go used to create a customizable frameworks

Hello fellow Gophers!, Ever been painted into a corner by a Framework? Ya me too! so without further ado I finally decided to release

lars - a lightweight, fast and extensible zero allocation HTTP router for Go used to create a customizable frameworks.

Finally released a large Web Application using this router and now consider it ready for production use. I hope it can help someone else out there in creating their own highly customizable framework

1 Like

@joeybloggs Hi, I am a Gin user,I found Lars’ APIs design is very like Gin, so what is Lars’ advantages ? Performance(maybe need a benchmark like this: go-http-routing-benchmark) or any other outstanding feaures ?

Hello @douglarek, thanks for you question; I highly recommend you read the projects README as I cover the unique features, but anyway here are some unique features:

  • Context is an interface so you can use your own Context and override the default methods to your needs or add some for your specific project, and build in facilities to pool and cache are handled for you.
  • Can handle multiple handler/middleware definitions (built in)
  • Can register custom handler/middleware handler ( this also allows you to register a handler for you custom Context and avoid type casting everywhere and just use your Context…best is to see the examples it’s far easier to see than explain )

As for performance lars uses a customised version of httprouter, just like gin, and they should be nearly equal, I do provide a link to the benchmarks in the README also so you can test and verify here it is https://github.com/joeybloggs/go-http-routing-benchmark/tree/master

I hope I answered all of your questions, if not let me know :slight_smile:

P.S. gin is a great framework, even uses my validator library, I’m not trying to replace gin or anything just providing the building blocks to quickly and easily create you own framework tailored to your own needs. I’ve never worked on a project where a framework didn’t eventually paint me into a corner at some point, probably because my projects are never simple, and lars is the answer for me.

1 Like

@joeybloggs thanks for your patient reply,Maybe I should go into it ~

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.