5
nitwhiz
3y

Coming from NodeJS, writing APIs with Express, I now do my first steps writing APIs in golang with gin.

Now I know, Express is not the fastest solution out there, but I mean - a good 30ms is alright for non-high-performance backends. And I always thought that's on the faster end of HTTP handling..

..but then I used gin. A GET request doing a MongoDB-write and returning some json. 3ms response time. THREE MILISECONDS. holy fuck. By it's debug logs the actual handling took 540 MICROSECONDS. holy fuck I'm in love.

Comments
  • 2
    Me sitting on this Kotlin project where most requests need over a second.
  • 3
    Interesting, I've been using Koa in NodeJS for a similar thing (GET request, 3 consecutive mongo queries and a redis lookup per request) and my production response time is around 9ms. As a note, my mongo and redis are on separate machines, so this time includes network latencies for mongo and redis requests.
  • 0
    @hitko I read about Koa, too, but did not try it so far. Sounds quite nice!
  • 0
  • 2
    Heard some good stories about Go performance wise. This one is added to the list 😉

    Good job on getting out of ur comfort zone! And appreciating its strengths 👍 We all should from time to time!
  • 1
    @100110111 The result of “Kotlin syntax is just like JavaScript - it’s super easy to learn”

    - the only person who is proficient with the Java ecoworld

    We have no fucking idea how shit works. His code looks like magic spaghetti.
  • 1
    @bagfox oh, well that explains.
  • 0
    @bagfox yes but does it taste magic?
Add Comment