Live data from Hacker News

Iris: Fast back-end web framework for Go

iris-go.com

51–60 of 125 posts

Re: Iris: Fast back-end web framework for Go

#51
post #48
post #5

Features: https://kataras.gitbooks.io/iris/content/features.html (seems to be missing a data/SQL/ORM layer) Usage docs for rest api: https://kataras.gitbooks.io/iris/content/render_rest.html#us...

Given the state of the art of golang ORMs, I guess this might be a plus. I have tried xorm and gorm (besides database/sql) and while I settled on gorm, they both have some fundamental design flaws: * xorm onInsert/onUpdate hooks are designed the wrong way. Last time I tried, hooks received object instances by value and not by reference, meaning I could not actually update things before hitting the database. * both xo…

Yeah, with GORM you have to generate the relationships manually.

Re: Iris: Fast back-end web framework for Go

#53
post #23

Could someone clarify: why is Go faster than say Python? And if the answer is just that it's a lower level language and therefore has less overhead, why not just use C?

Go actually lets you work at a quite high level, much like C# or Java (and the performance is in the same ballpark). I think a better question to ask is: why is Python so slow?

Ok, so why is Python so slow (comparatively)? I had understood that must of the speed-critical tasks in python were done by wrappers of lower-level C code. Example: numpy. Is this not correct?

Re: Iris: Fast back-end web framework for Go

#54
post #41

Earlier quoted context omitted.

IIRC, Go code compiled with the gc compiler has about the same performance as Java running on the JVM. Surely Go isn't much faster than Java.

You are mostly correctly. There are some things that Go can do to perform better than Java. Go arrays have one less step of indirection compared to Java arrays. And Go allows for more control about the memory layout of structs/classes and arrays.

But it also doesn't perform as well with large data sets and has less compiler optimizations and no JIT.

Saying Go is much faster than Java is nonsense.

Re: Iris: Fast back-end web framework for Go

#55
post #42

Earlier quoted context omitted.

From my understanding, the main reasons are that python is interpreted and has the global interpreter lock: https://wiki.python.org/moin/GlobalInterpreterLock .

The GIL makes Python faster than a Python without it would be.

yeah, the GIL only slows down threaded code. The big reason that the GIL hasn't been removed is that any patch removing the GIL slows single threaded performance.

Re: Iris: Fast back-end web framework for Go

#56
post #23

Could someone clarify: why is Go faster than say Python? And if the answer is just that it's a lower level language and therefore has less overhead, why not just use C?

C is hard. You're right though, why not use C? It's a good language, and it's hard to beat for it's low level powers, portability and speed. What go gives you is high level productivity, testing, a solution for package management (abit a rubbish one), and a good ecosystem of 3rd party libraries for things like AWS. The things that suck about C: - It's hard to do right. There's a great book called 'Deep C Secrets' on…

I have to write a whole bunch of

  if Sys.info()["sysname"] == "Windows"
even in R!

Re: Iris: Fast back-end web framework for Go

#57
post #23

Could someone clarify: why is Go faster than say Python? And if the answer is just that it's a lower level language and therefore has less overhead, why not just use C?

C is hard. You're right though, why not use C? It's a good language, and it's hard to beat for it's low level powers, portability and speed. What go gives you is high level productivity, testing, a solution for package management (abit a rubbish one), and a good ecosystem of 3rd party libraries for things like AWS. The things that suck about C: - It's hard to do right. There's a great book called 'Deep C Secrets' on…

Thanks for this answer. After reading it it seems to me that every other answer is just saying "C is hard" with a lot of words.

Re: Iris: Fast back-end web framework for Go

#58
post #3

The performance comes from using https://github.com/valyala/fasthttp instead of the stdlib net/http. From this project's FAQ: >Why creating yet another http package instead of optimizing net/http? Because net/http API limits many optimization opportunities.

And then you got your database and you speed is comparable to the rest of the world :) What I think could work is a pure in memory database with server combination. Something like redis for websites.

Like ETS/DETS for Elixir/Erlang?

Re: Iris: Fast back-end web framework for Go

#59
post #23

Could someone clarify: why is Go faster than say Python? And if the answer is just that it's a lower level language and therefore has less overhead, why not just use C?

Go has high level constructs like python, C# or Java. However, it compiles down to machine code directly, like C. This is much faster than C# or Java, which compile to an intermediate interface (CLR and java bytecode respectively, which then run in a VM), and miles ahead of Python, which interprets from the source every single time the program is run. The closest language to go would probably be C++, and the language…

> This is much faster than C# or Java, which compile to an intermediate interface (CLR and java bytecode respectively, which then run in a VM).

Except there are things like ExcelsiorJET, CodenameONE, J9, .NET Native, CoreRT, Mono -AOT, IL2CPP.

As usual, language and implementation aren't the same thing.

Re: Iris: Fast back-end web framework for Go

#60
post #23

Could someone clarify: why is Go faster than say Python? And if the answer is just that it's a lower level language and therefore has less overhead, why not just use C?

C is hard. You're right though, why not use C? It's a good language, and it's hard to beat for it's low level powers, portability and speed. What go gives you is high level productivity, testing, a solution for package management (abit a rubbish one), and a good ecosystem of 3rd party libraries for things like AWS. The things that suck about C: - It's hard to do right. There's a great book called 'Deep C Secrets' on…

>Have a look at this excellent highly portable IPC library: https://github.com/saprykin/plibsys >[...]

>...but for a web service or web framework?

>nah.

>Go was written specifically for those purposes, with high throughput performance as its goal, and a significant amount of effort devoted to optimizing that.

>It's not suitable for something like plibsys either.

I found this part of your comment difficult to understand. Is C not suitable for plibsys after all, or is it Go which wouldn't be suitable, or something else?

Post reply on HN