Live data from Hacker News

Rails 5.0: Action Cable, API mode, and more

weblog.rubyonrails.org

201–210 of 225 posts

Re: Rails 5.0: Action Cable, API mode, and more

#201
post #196
post #170

Earlier quoted context omitted.

I would say languages that can leverage concurrency and do pooling well will generally put less pressure on the database for the same load. Rails in particular is very wasteful in terms of connection management, typically checking out the database connection for the duration of the whole request. If you have a machine with 4 cores, one of Rails deployments would start 4 processes each with 10 database connections. So…

These are good points, but they regard the system as a whole. Is that what's "12 times faster"? I don't like big claims without seeing some more detailed numbers and methodology.

To clarify, I was not the one doing the claiming. My only point is that there is much more than meets the eyes so 12 times faster is possible. I haven't deployed Rails in a long while so I have no data from the performance perspective.

Re: Rails 5.0: Action Cable, API mode, and more

#202
post #199

Earlier quoted context omitted.

Sure! But this time (tm) it's different. Phoenix is a direct drop-in replacement for rails, with a bunch of strong benefits on top. Getting productive for a rails developer should be 1-2 weeks max, since one already knows how the framework works conceptually. The truly cool stuff happens when one learns how stuff works beneath the surface. While you're around: Elixir/Erlang in itself is a rather slow language when it…

You might be interested in this project: https://github.com/hansihe/Rustler

this looks like it could really fit. Can I use this in a phoenix app and then deploy to Heroku without problems?

Re: Rails 5.0: Action Cable, API mode, and more

#203

I'm happy to see the new way to render views outside the request cycle: http://blog.bigbinary.com/2016/01/08/rendering-views-outside... This will be great for, eg, creating reports or receipts in background jobs.

This was possible in Rails 4 using the Render Anywhere gem.

Re: Rails 5.0: Action Cable, API mode, and more

#204
post #197

Earlier quoted context omitted.

> but Erlang/beam code is not that fast. True, no doubt. You wanted a comparison why phoenix is faster than rails. And simply doing things at compile time reduces work at runtime. In Ruby, all Metaprogramming must be done at runtime, for example via method_missing trickery (been there, done that). > Ruby's templates are parsed into code that stays in memory, too, so it's not like they're re-parsed each and every time…

All good points. As I keep saying, I'm an Erlang fan. I actually used it at my last job, and have used it on and off since 2004-ish. It definitely has some advantages, but I'm just curious where it's actually beating Rails, and with what kinds of workloads and test methodology and so on. Stuff like "Erlang processes are lighter" matters in some contexts, but not in a straight up speed contest. It matters a lot when y…

I'd say you really should have a look into https://www.youtube.com/watch?v=OxhTQdcieQE . A really great presentation, including numbers and real world backup data, plus conceptual overviews.

Re: Rails 5.0: Action Cable, API mode, and more

#205
post #182

Earlier quoted context omitted.

There is a difference this time. Phoenix and Elixir was created specifically with an eye towards Ruby developers. Jose is working for a Ruby shop from what I understand. Go was C++ ++ or Java++ or Python++, Node was front-end brought to the backend kinds deal (or "you only need to know only language" deal). Clojure is an interesting one, but I haven't gotten much to play with it, so don't have much to say about it.

Clojure will never take off as a "Rails killer" because well, it's a Lisp. Sounds superficial but it's the truth. Also, from what I see it doesn't have an opinionated framework like Phoenix or Rails. That said, neither does Node.

There's Luminus: http://www.luminusweb.net/

And then there's its competitor, Arachne: http://arachne-framework.org/

Re: Rails 5.0: Action Cable, API mode, and more

#206
post #85

Concurrency aside, why is Elixir preferred over Ruby when it doesn't even have a native array implementation? No, lists and tuples are no substitute nor are maps with numeric keys as Jose has suggested. If you want an array in Elixir your only option is Erlang's implementation which ain't pretty - http://erlang.org/doc/man/array.html . When I raised this issue in the mailing list and on IRC the response was invariabl…

Python lacks a native array too but its list type seems to do just fine. What is it you want to do that you that requires an array?

incorrect. python has array.array which behaves just like in C. You even give the type of the data.

Re: Rails 5.0: Action Cable, API mode, and more

#207

Earlier quoted context omitted.

Converting? Absolutely not. A greenfield project? Sure why not, it's a great choice.

Depends on who is building it, who is supporting it after it is built, etc. I have seen companies with "technology sprawl" where project after project was done in the shiny new thing. No thanks, it's an ops and maintenance nightmare. Not to say you shouldn't choose this solution, just do it with an eye to the future.

Elixir is firmly planted in that future.

Re: Rails 5.0: Action Cable, API mode, and more

#208
post #197

Earlier quoted context omitted.

All good points. As I keep saying, I'm an Erlang fan. I actually used it at my last job, and have used it on and off since 2004-ish. It definitely has some advantages, but I'm just curious where it's actually beating Rails, and with what kinds of workloads and test methodology and so on. Stuff like "Erlang processes are lighter" matters in some contexts, but not in a straight up speed contest. It matters a lot when y…

I'd say you really should have a look into https://www.youtube.com/watch?v=OxhTQdcieQE . A really great presentation, including numbers and real world backup data, plus conceptual overviews.

It's pretty good, but a bit hype-y.

Functional programming is not an 'antidote' to having to go back and read old code or necessarily understanding it easily.

It references this:

http://sorentwo.com/2016/02/02/caching-what-is-it-good-for.h...

Which is interesting, but I don't see source code. 1.5-2X is pretty believable, but quite a bit less than "12 times" - which someone quoted here.

Re: Rails 5.0: Action Cable, API mode, and more

#209

We've moved all of our backend offerings from Rails to Elixir/Phoenix. Despite some questioning the value of anything below 100ms response times there is a lot of data backing up the idea that Elixir/Phoenix can lead to a more maintainable and more economical solution. I spoke about this recently at RailsConf: https://www.youtube.com/watch?v=OxhTQdcieQE Don't get me wrong, I think Rails is an amazing technology but i…

This is the equivalent to Kanye interrupting Swift: "Rails, Imma let you finish, but Elixir/Phoenix is really where it's at right now."

Re: Rails 5.0: Action Cable, API mode, and more

#210
post #208

Earlier quoted context omitted.

I'd say you really should have a look into https://www.youtube.com/watch?v=OxhTQdcieQE . A really great presentation, including numbers and real world backup data, plus conceptual overviews.

It's pretty good, but a bit hype-y. Functional programming is not an 'antidote' to having to go back and read old code or necessarily understanding it easily. It references this: http://sorentwo.com/2016/02/02/caching-what-is-it-good-for.h... Which is interesting, but I don't see source code. 1.5-2X is pretty believable, but quite a bit less than "12 times" - which someone quoted here.

I can personally confirm above 10x improvements over rails, but can't Share the code :)

Depends on what you're doing though. Seems to excel when having low CPU intensive workloads but high traffic pressure from my experience.

Post reply on HN