FAQ
Hi gophers,

I just put the finishing touches on https://github.com/gocraft/web .

Basic features:
- Routing, capturing variables in the path, regexp path matching.
- Run middleware, then execute your handler
- Default middleware: logging, error recovery, static file serving.

Unique-ish things it brings to the table:
- Your own contexts. Easily pass information between your middleware and
handler with strong static typing.
- Nested routers, contexts, and middleware. Your app has an API, and admin
area, and a logged out view. Each view needs different contexts and
different middleware. We let you express this hierarchy naturally.
- Fast. Most other solutions loop over your routes in an O(N) fashion and
do regexp matching on everything. We try to be smarter.

Would love your thoughts.

- Jonathan Novak
Head of Engineering @ UserVoice

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Lucy Mason at Dec 1, 2013 at 10:30 pm
    Looks really good. I've played around with it a bit and it's really easy to
    get going.

    Does anyone know how this compares to other Go web frameworks?
    On Saturday, November 30, 2013 9:04:16 PM UTC-8, jno...@gmail.com wrote:

    Hi gophers,

    I just put the finishing touches on https://github.com/gocraft/web .

    Basic features:
    - Routing, capturing variables in the path, regexp path matching.
    - Run middleware, then execute your handler
    - Default middleware: logging, error recovery, static file serving.

    Unique-ish things it brings to the table:
    - Your own contexts. Easily pass information between your middleware and
    handler with strong static typing.
    - Nested routers, contexts, and middleware. Your app has an API, and admin
    area, and a logged out view. Each view needs different contexts and
    different middleware. We let you express this hierarchy naturally.
    - Fast. Most other solutions loop over your routes in an O(N) fashion and
    do regexp matching on everything. We try to be smarter.

    Would love your thoughts.

    - Jonathan Novak
    Head of Engineering @ UserVoice
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Nguyen at Dec 2, 2013 at 5:33 am
    Hi Jonathan,

    just tried it out and seemed nice. Which other frameworks did you test your
    benchmarks against?

    Den söndagen den 1:e december 2013 kl. 06:04:16 UTC+1 skrev
    jno...@gmail.com:
    Hi gophers,

    I just put the finishing touches on https://github.com/gocraft/web .

    Basic features:
    - Routing, capturing variables in the path, regexp path matching.
    - Run middleware, then execute your handler
    - Default middleware: logging, error recovery, static file serving.

    Unique-ish things it brings to the table:
    - Your own contexts. Easily pass information between your middleware and
    handler with strong static typing.
    - Nested routers, contexts, and middleware. Your app has an API, and admin
    area, and a logged out view. Each view needs different contexts and
    different middleware. We let you express this hierarchy naturally.
    - Fast. Most other solutions loop over your routes in an O(N) fashion and
    do regexp matching on everything. We try to be smarter.

    Would love your thoughts.

    - Jonathan Novak
    Head of Engineering @ UserVoice
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jnovak at Dec 2, 2013 at 3:19 pm
    Peter,

    Thanks!

    I just now created a quick-and-dirty benchmark to test gocraft/web,
    gorilla/mux, and Martini.

    https://github.com/cypriss/golang-mux-benchmark/

    Output:

    BenchmarkGocraftWebSimple 1000000 2517 ns/op
    BenchmarkGorillaMuxSimple 500000 3585 ns/op
    BenchmarkCodegangstaMartiniSimple 200000 8026 ns/op

    Keep in mind this benchmark is on the more useless side since it only tests "hello world": 1 route, no middleware, etc. I plan to add more comprehensive benchmarking soon... any PR's welcome of course :)


    On Sunday, December 1, 2013 9:33:16 PM UTC-8, Peter Nguyen wrote:

    Hi Jonathan,

    just tried it out and seemed nice. Which other frameworks did you test
    your benchmarks against?

    Den söndagen den 1:e december 2013 kl. 06:04:16 UTC+1 skrev
    jno...@gmail.com:
    Hi gophers,

    I just put the finishing touches on https://github.com/gocraft/web .

    Basic features:
    - Routing, capturing variables in the path, regexp path matching.
    - Run middleware, then execute your handler
    - Default middleware: logging, error recovery, static file serving.

    Unique-ish things it brings to the table:
    - Your own contexts. Easily pass information between your middleware and
    handler with strong static typing.
    - Nested routers, contexts, and middleware. Your app has an API, and
    admin area, and a logged out view. Each view needs different contexts and
    different middleware. We let you express this hierarchy naturally.
    - Fast. Most other solutions loop over your routes in an O(N) fashion and
    do regexp matching on everything. We try to be smarter.

    Would love your thoughts.

    - Jonathan Novak
    Head of Engineering @ UserVoice
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jnovak at Dec 3, 2013 at 4:56 am
    I added a benchmark to https://github.com/cypriss/golang-mux-benchmark/
    that indicates how expensive routing is as you add more routes.

    Results:

    BenchmarkGocraftWebSimple 1000000 2522 ns/op
    BenchmarkGocraftWebRoute15 500000 3813 ns/op
    BenchmarkGocraftWebRoute75 500000 3887 ns/op
    BenchmarkGocraftWebRoute150 500000 3942 ns/op
    BenchmarkGocraftWebRoute300 500000 3903 ns/op
    BenchmarkGocraftWebRoute3000 500000 4429 ns/op

    BenchmarkGorillaMuxSimple 500000 3564 ns/op
    BenchmarkGorillaMuxRoute15 100000 17762 ns/op
    BenchmarkGorillaMuxRoute75 100000 31095 ns/op
    BenchmarkGorillaMuxRoute150 50000 41708 ns/op
    BenchmarkGorillaMuxRoute300 50000 74333 ns/op
    BenchmarkGorillaMuxRoute3000 5000 651023 ns/op

    BenchmarkCodegangstaMartiniSimple 200000 8665 ns/op
    BenchmarkCodegangstaMartiniRoute15 100000 16192 ns/op
    BenchmarkCodegangstaMartiniRoute75 100000 20267 ns/op
    BenchmarkCodegangstaMartiniRoute150 100000 25183 ns/op
    BenchmarkCodegangstaMartiniRoute300 50000 34053 ns/op
    BenchmarkCodegangstaMartiniRoute3000 10000 208872 ns/op

    BenchmarkTigerTonicTrieServeMux 5000000 422 ns/op



    I'm going to do a benchmark that incorporates middleware next. Will
    probably be EOD tomorrow by the time I get that.

    Also, I got a PR from tigertonic. Wouldn't mind PR's from any other web
    frameworks.
    On Monday, December 2, 2013 7:18:59 AM UTC-8, jno...@gmail.com wrote:

    Peter,

    Thanks!

    I just now created a quick-and-dirty benchmark to test gocraft/web,
    gorilla/mux, and Martini.

    https://github.com/cypriss/golang-mux-benchmark/

    Output:

    BenchmarkGocraftWebSimple 1000000 2517 ns/op
    BenchmarkGorillaMuxSimple 500000 3585 ns/op
    BenchmarkCodegangstaMartiniSimple 200000 8026 ns/op

    Keep in mind this benchmark is on the more useless side since it only tests "hello world": 1 route, no middleware, etc. I plan to add more comprehensive benchmarking soon... any PR's welcome of course :)


    On Sunday, December 1, 2013 9:33:16 PM UTC-8, Peter Nguyen wrote:

    Hi Jonathan,

    just tried it out and seemed nice. Which other frameworks did you test
    your benchmarks against?

    Den söndagen den 1:e december 2013 kl. 06:04:16 UTC+1 skrev
    jno...@gmail.com:
    Hi gophers,

    I just put the finishing touches on https://github.com/gocraft/web .

    Basic features:
    - Routing, capturing variables in the path, regexp path matching.
    - Run middleware, then execute your handler
    - Default middleware: logging, error recovery, static file serving.

    Unique-ish things it brings to the table:
    - Your own contexts. Easily pass information between your middleware and
    handler with strong static typing.
    - Nested routers, contexts, and middleware. Your app has an API, and
    admin area, and a logged out view. Each view needs different contexts and
    different middleware. We let you express this hierarchy naturally.
    - Fast. Most other solutions loop over your routes in an O(N) fashion
    and do regexp matching on everything. We try to be smarter.

    Would love your thoughts.

    - Jonathan Novak
    Head of Engineering @ UserVoice
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Nguyen at Dec 4, 2013 at 11:06 am
    Good numbers, how is it compared to when not using reflect I wonder...

    Den söndagen den 1:e december 2013 kl. 06:04:16 UTC+1 skrev
    jno...@gmail.com:
    Hi gophers,

    I just put the finishing touches on https://github.com/gocraft/web .

    Basic features:
    - Routing, capturing variables in the path, regexp path matching.
    - Run middleware, then execute your handler
    - Default middleware: logging, error recovery, static file serving.

    Unique-ish things it brings to the table:
    - Your own contexts. Easily pass information between your middleware and
    handler with strong static typing.
    - Nested routers, contexts, and middleware. Your app has an API, and admin
    area, and a logged out view. Each view needs different contexts and
    different middleware. We let you express this hierarchy naturally.
    - Fast. Most other solutions loop over your routes in an O(N) fashion and
    do regexp matching on everything. We try to be smarter.

    Would love your thoughts.

    - Jonathan Novak
    Head of Engineering @ UserVoice
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jnovak at Dec 10, 2013 at 4:29 pm
    FYI I have updated https://github.com/cypriss/golang-mux-benchmark. I added
    a new framework, Traffic. I also added two new benchmarks: Middleware, and
    Composite.

    Peter, to answer your question, I just ran pprof on gocraft/web. It is
    indeed "expensive" to use reflect.Call to invoke a function. You can see
    this in the middleware test. I think I can optimize this quite a bit
    (another slow spot is all the slices I create).
    On Wednesday, December 4, 2013 3:06:05 AM UTC-8, Peter Nguyen wrote:

    Good numbers, how is it compared to when not using reflect I wonder...

    Den söndagen den 1:e december 2013 kl. 06:04:16 UTC+1 skrev
    jno...@gmail.com:
    Hi gophers,

    I just put the finishing touches on https://github.com/gocraft/web .

    Basic features:
    - Routing, capturing variables in the path, regexp path matching.
    - Run middleware, then execute your handler
    - Default middleware: logging, error recovery, static file serving.

    Unique-ish things it brings to the table:
    - Your own contexts. Easily pass information between your middleware and
    handler with strong static typing.
    - Nested routers, contexts, and middleware. Your app has an API, and
    admin area, and a logged out view. Each view needs different contexts and
    different middleware. We let you express this hierarchy naturally.
    - Fast. Most other solutions loop over your routes in an O(N) fashion and
    do regexp matching on everything. We try to be smarter.

    Would love your thoughts.

    - Jonathan Novak
    Head of Engineering @ UserVoice
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 1, '13 at 5:04a
activeDec 10, '13 at 4:29p
posts7
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase