@thomasfuchs wow sorry. $1,500/month for health insurance seems a fuckton... especially if they won't pay anything in return. :(

Testing out Ruby 3.1 with vs Ruby 3.0.

This shows a sharp decrease of CPU usage for a small Sinatra-based API.

Improvements in response times aren't as visible because the app is mostly IO bound. The app is small, so the memory penalty is light too. I like it.

Thanks Shopify. 👍

Welcome to the new & returning ruby.social users. Hope we can engage better this time.

Please try to follow up other peers, create your and pin your toot.

Remember this is not a "new twitter" the idea is kind of different. You can check @feditips to get more insights about how the federation works and how to have a better integrated environments.

P.S. there's no edit feature, but you can delete & redraft as I did with this toot.

So, the solution is to not use this Ruby 2 feature anymore. I've taken to using pattern-matching instead.

Yes, it is more verbose in some cases. Not a big deal.

Show thread

I'm porting 2.7 Ruby to Ruby 3, and I'm having trouble iterating an array of hashes with de-structuring keyword args.

Previously, this worked:

a = [{:foo=>1, :bar=>1}, {:foo=>2, :bar=>2}]
a.each { |foo:, bar:| puts "foo: #{foo}, bar: #{bar}" }

With , how do you de-structure each item inline? 🤔

Oh. I managed to miss the RailsConf drama, until I opened the Ruby Weekly newsletter.

I'm sad to say that all the shits of the weeks had already been given at this point. 🤷

Are you WIP-ing son? This is (part of) the commit-logs from a pull-request I was reviewing today.

It made me smile. 😄

On the announcement post for Crystal 1.2: "On a bit of a sour note, we are demoting support for 32-bit x86 architectures, moving it from Tier 1 to Tier 2 (that is, /expected to build/). As a result, we will not be shipping i386 packages this time. The reason is that the specs are failing, likely due to the amount of memory they consume."

A little bit sad to read this. Of course, you could build the compiler, but I read it as a warning against Crystal where memory matters.

The HN comments about the CoC change for Ruby are really fun to read. So many privileged people taking offense as they're required to be nice.


@alexanderadam this benchmarks 2 redis gems against TCPSocket, essentially. :)

I really want to use the nice dry gems but you can't nest their validators, and there's no way to add custom rules to their schemas (which you can nest 🥲). There are issues and PRs about it since 2019... 😖

I'm pretty sure I could replace the legacy validators with something simpler like Scrivener, because I don't want to reinvent this wheel. 🙃

During a code review, I found code where we were using `Enumerable#find` to choose a value from an array, against data ; building a new Regex on each loop. When your array is sorted `` is orders of magnitude faster:

❯ ruby bm.rb
user system total real
justfind 25.743317 0.048932 25.792249 ( 25.791471)
bsearch 3.192201 0.003215 3.195416 ( 3.195469)
cache 0.285086 0.000304 0.285390 ( 0.285395)

Also, cache things when possible. 😅

I was looking at Babosa (github.com/norman/babosa), when I noticed the project is used "a lot" by python devs. 😆

This may not last long, but I find it nice that robots are using Github to auto-generate stuff ; after all Github's opened the box with their own "AI" bot. Still, probably just annoying marketing.

@phil_pirozhkov I upgraded to the latest version of Sidekiq a few days ago and I'm still waiting for the next "lock" to happen.

It appears to happen in Sidekiq's processor thread, which fell into an infinite loop. After all with no concurrency on worker threads, it may be the only place where things could lock up.

I really like having several "legs" to deploy new features or bug fixes progressively ; but having feature flags to target a few users would also help. 🤔

Show older

A Mastodon instance for Rubyists & friends