Live data from Hacker News

Reducing Memory Usage in Ruby

tenderlovemaking.com

31–40 of 58 posts

Re: Reducing Memory Usage in Ruby

#31
post #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

I thought he was nuts already. (Smiley thing here.)

Re: Reducing Memory Usage in Ruby

#32
post #21
post #17

Earlier quoted context omitted.

You can do all of that with really easy to write crystal macros.

You can dynamically build at runtime an HTTP client from an OpenAPI spec (unavailable until runtime, to be clear), method-by-method, using macros? Tell me more.

Although it probably does not fit your use case something like Common Lisp would shine in a situation like this.

You can build your code at runtime from the spec and then compile it at runtime to get pretty good performance.

Re: Reducing Memory Usage in Ruby

#33
post #24

Ruby seems to have a footprint on Hacker News disproportionate to its general popularity and TIOBE index. Why?

Ruby and Rails have been around for about 10 years at this point. It is stable and for most websites it just works (up to a certain size). It is not as exciting as JS is now but people are using it to get things done since it is relatively mature and used a lot in startups. Likely why you see it referenced a lot here.

Re: Reducing Memory Usage in Ruby

#34
post #24

Ruby seems to have a footprint on Hacker News disproportionate to its general popularity and TIOBE index. Why?

Not only due to the popularity of Rails, Ruby has become popular for sysadmins as config management solutions such as puppet and chef are built on top of it. The resulting syntax is very ruby like, and in some cases you are even required to write a few ruby blocks here and there.

It also has an amazing testing framework in the form of rspec, which can be used for much more than just testing Ruby code.

Re: Reducing Memory Usage in Ruby

#35
post #32
post #21

Earlier quoted context omitted.

You can dynamically build at runtime an HTTP client from an OpenAPI spec (unavailable until runtime, to be clear), method-by-method, using macros? Tell me more.

Although it probably does not fit your use case something like Common Lisp would shine in a situation like this. You can build your code at runtime from the spec and then compile it at runtime to get pretty good performance.

Sure. Or I get effectively the same thing with JavaScript. (I just don't much like Node--it's not bad but it's not great--and the dev experience for specifying something like a DSL is a bummer.)

Re: Reducing Memory Usage in Ruby

#36
post #24

Ruby seems to have a footprint on Hacker News disproportionate to its general popularity and TIOBE index. Why?

> Ruby seems to have a footprint on Hacker News disproportionate to its general popularity and TIOBE index.

TIOBE index is a junk metric (I'm surprised so many technical people seem to buy into it; it's the worst kind of easy to get a precise number, hard to demonstrate that that number has any more than a very distant relationship to anything meaningful, kind of metric that, IME, tech people mock bad managers for buying into.)

That said, Ruby’s got (via Rails and other web frameworks, and via various testing and admin tools) a very strong footprint in use even if it's no longer the hype-of-the-month.

Re: Reducing Memory Usage in Ruby

#37
post #24

Ruby seems to have a footprint on Hacker News disproportionate to its general popularity and TIOBE index. Why?

Not only due to the popularity of Rails, Ruby has become popular for sysadmins as config management solutions such as puppet and chef are built on top of it. The resulting syntax is very ruby like, and in some cases you are even required to write a few ruby blocks here and there. It also has an amazing testing framework in the form of rspec, which can be used for much more than just testing Ruby code.

Yeah, and i use Selenium with Ruby as well.

Re: Reducing Memory Usage in Ruby

#38
post #24

Ruby seems to have a footprint on Hacker News disproportionate to its general popularity and TIOBE index. Why?

HN is not at all representative of the wider programming community. HN attracts a lot of people working for trendy startup companies and is very silicon valley centric, but that is a tiny portion of the programmers world wide who are much more likely to be working on a java project for a generic business than using the latest fad.

TIOBE has it's issues but as a rough guide to what the industry is actually using I think it's in the ballpark.

Re: Reducing Memory Usage in Ruby

#39
post #30
post #28

Earlier quoted context omitted.

Got me there. First time I've ever in my life heard of a legitimate example where you really do need dynamic methods.

If you're doing stuff with OpenAPI (as I've been doing over the last few weeks), it becomes a pressing thing. =( Generated clients usually are pretty awful, you usually have to generate your own (because they don't publish gems when their APIs change, which is why I've written online-generated ones!), and once you've completed the bootstrap process for an HTTP client, it's as fast as any other Ruby thing. Which is no…

See GraniteORM or my crystal-mongo-orm. You just have to specify your fields at compile time and you are good-to-go. It works just like active record.

https://github.com/amberframework/granite-orm https://github.com/sam0x17/crystal-mongo-orm

Re: Reducing Memory Usage in Ruby

#40
post #10
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…

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 ba…

Wow. I've been checking in on the Crystal ecosystem every few weeks, but I somehow missed Amber. It feels like someone has finally cracked the code that made Rails great.
Post reply on HN