Live data from Hacker News

Reducing Memory Usage in Ruby

tenderlovemaking.com

1–10 of 58 posts

Re: Reducing Memory Usage in Ruby

#3
What I'd like to be able to do is load ActiveRecord (or any other v. heavy lib) asynchronously in non web-based apps so that I can paint the UI quicker. By the time the user will do/need anything db-related a proxy object should be swapped out for an actual ActiveRecord object. Using Rails' ORM is so nice and ergonomic but it kills start-up time with all the file requires, Bootsnap helps a bit but I'd prefer not to have to use it as it is yet one other moving part to consider.

Re: Reducing Memory Usage in Ruby

#4
post #2

Or just use Crystal https://crystal-lang.org XD

Crystal is not a replacement for Ruby. In the same way that many Algol-like languages are not a straight swap for each other. Don't get me wrong, Crystal is a nice idea but say goodbye to all that yummy Ruby meta-programming which is one of the key things what makes the language so appealing in the first place.

Re: Reducing Memory Usage in Ruby

#5
post #2

Or just use Crystal https://crystal-lang.org XD

Crystal is not a replacement for Ruby. In the same way that many Algol-like languages are not a straight swap for each other. Don't get me wrong, Crystal is a nice idea but say goodbye to all that yummy Ruby meta-programming which is one of the key things what makes the language so appealing in the first place.

Exactly. As a Ruby developer, Crystal makes me itch. It jettisons exactly what Ruby is valuable to me for: quickly and dynamically building fluent-feeling libraries and tools. It's fast, but I don't need fast--if I don't need Ruby's metaprogramming, I have other, better, established languages to use for those tasks. (Kotlin, C#, Rust, whatever.)

Elixir is kind-of in the same boat for me. I think it's neat and has its place, and BEAM is really cool, but it doesn't scratch the Ruby itch for me. I just don't care about it looking vaguely like Ruby if it's not actually gonna be Ruby.

Re: Reducing Memory Usage in Ruby

#6
post #5

Earlier quoted context omitted.

Crystal is not a replacement for Ruby. In the same way that many Algol-like languages are not a straight swap for each other. Don't get me wrong, Crystal is a nice idea but say goodbye to all that yummy Ruby meta-programming which is one of the key things what makes the language so appealing in the first place.

Exactly. As a Ruby developer, Crystal makes me itch . It jettisons exactly what Ruby is valuable to me for: quickly and dynamically building fluent-feeling libraries and tools. It's fast, but I don't need fast--if I don't need Ruby's metaprogramming, I have other, better, established languages to use for those tasks. (Kotlin, C#, Rust, whatever.) Elixir is kind-of in the same boat for me. I think it's neat and has it…

Elixir is, in my view, an even-more-awesome Erlang with an unfortunate and distracting cosmetic resemblance to Ruby.

Ruby is awesome, as is Elixir, but very different awesome.

Re: Reducing Memory Usage in Ruby

#7
post #5

Earlier quoted context omitted.

Exactly. As a Ruby developer, Crystal makes me itch . It jettisons exactly what Ruby is valuable to me for: quickly and dynamically building fluent-feeling libraries and tools. It's fast, but I don't need fast--if I don't need Ruby's metaprogramming, I have other, better, established languages to use for those tasks. (Kotlin, C#, Rust, whatever.) Elixir is kind-of in the same boat for me. I think it's neat and has it…

Elixir is, in my view, an even-more-awesome Erlang with an unfortunate and distracting cosmetic resemblance to Ruby. Ruby is awesome, as is Elixir, but very different awesome.

Agreed, to be clear. I think Elixir is cool. It just keeps getting framed as a "better Ruby"--though Phoenix might be (probably is) a better Rails.

Re: Reducing Memory Usage in Ruby

#9
I am so happy that Github have hired Tenderlove to go nuts with these type of projects. His talks are always extremely fun and interesting.

I run Ruby with jemalloc, and I know that samsaffron have tried to include it within the Ruby releases (like Redis does), but progress seems to have been stalled https://bugs.ruby-lang.org/issues/9113

Re: Reducing Memory Usage in Ruby

#10
post #5

Earlier quoted context omitted.

Crystal is not a replacement for Ruby. In the same way that many Algol-like languages are not a straight swap for each other. Don't get me wrong, Crystal is a nice idea but say goodbye to all that yummy Ruby meta-programming which is one of the key things what makes the language so appealing in the first place.

Exactly. As a Ruby developer, Crystal makes me itch . It jettisons exactly what Ruby is valuable to me for: quickly and dynamically building fluent-feeling libraries and tools. It's fast, but I don't need fast--if I don't need Ruby's metaprogramming, I have other, better, established languages to use for those tasks. (Kotlin, C#, Rust, whatever.) Elixir is kind-of in the same boat for me. I think it's neat and has it…

Have you used a recent (2017) version of Crystal? Quickly building fluent-feeling libraries and tools is exactly my use case for Crystal.

For me, everything that Ruby is valuable for is retained. I'm able to do all the things I did in Ruby just fine, and it prevents me from doing a lot of things I shouldn't have been doing.

We recently migrated our app from Rails to Crystal (using the Amber framework) and our code base is now 2/3rds the size and we eliminated hundreds of bugs in the process simply from static typing and explicit nil handling. Our response times are also now all under 30ms where we were at 100ms+ before.

Post reply on HN