HNHacker News
TopNewBestAskShowJobs

byroot

1,948 karma · joined July 20, 2012

submissionscomments
byroot··on Fastpotify
> Uses 1.5GB of RAM on my laptop atm.

That's crazy, I just checked on mine (macOS), it's only ~300MiB, about as much as Apple Mail which is native.

Still a bit much for what I need it for, but tolerable.

byroot··on Winding Down Artichoke Ruby
Nope. It’s been the default MRI parser for a couple years now.
byroot··on Winding Down Artichoke Ruby
TruffleRuby is pretty close too, if anything it’s even a bit more compatible because it’s able to run native extensions.

Also keeping compatible with MRI have been made significantly easier by Prism, the new parser that is shared by all implementations.

byroot··on Ruby Central's Destructive Legacy
> lost 3 of 3 members of the Open Source Committee (Gabi, Mike, Ufuk)

This is rich given they left in big part because of how much abuse they have received by "supporters" of André & co...

byroot··on Future euro banknote design proposals
There's a public survey: https://surveys.ecb.europa.eu/10b/neweuro/
byroot··on Why malloc always does more than I asked for?
That's why C23 introduce free_sized [0].

[0] https://en.cppreference.com/c/memory/free_sized

byroot··on Ghostty is leaving GitHub
Similarly, when writing Facebook apps with Rails, when you'd hit that same bug you'd see Mark Zuckerbeg: https://www.facebook.com/profile.php?id=4
byroot··on Optimizing Ruby Path Methods
It was just one of many.

Alone it wouldn't have been very noticeable, but I did many small optimizations like that, which ultimately shaved about 20 seconds of setup time.

Looking from another angle, the app boot time on CI (not eager loading) was a bit more than 10 seconds, this saved over half a second, so a ~5% gain for an afternoon of work.

byroot··on Optimizing Ruby Path Methods
https://github.com/ruby/ruby/blob/master/NEWS.md
byroot··on Optimizing Ruby Path Methods
Nothing ground breaking we simply deploy Buildkite agents on EC2 nodes.

As mentioned in the post, the only thing really limiting CI parallelism is the ratio of "setup time" vs "test time". If your setup time is too long, you hit diminishing returns fast.

byroot··on Optimizing Ruby Path Methods
Aside from the oddness of making this cache git aware, with the new implementation I suspect querying git to revalidate the cache would take longer than just rebuilding it.
byroot··on GitHub Stacked PRs
> every method call is a string dict lookup

Doesn't the Python VM have inline caches? [0]

https://en.wikipedia.org/wiki/Inline_caching

byroot··on France pulls last gold held in US
Nitpick, but France never left NATO proper, only the integrated command, and reintegrated it in 2008 under Sarkozy.
byroot··on I’m leaving Redis for SolidQueue
That's also something Rails helps abstract away by automatically deferring enqueues to after the transaction completed.

Even SolidQueue behave that way by default.

https://github.com/rails/rails/pull/51426

byroot··on I’m leaving Redis for SolidQueue
> The ideal situation with Rails would be if there is a simple way to switch back to Redis

That's largely the case.

Rails provide an abstracted API for jobs (Active Job). Of course some application do depend on queue implementation specific features, but for the general case, you just need to update your config to switch over (and of course handle draining the old queue).

byroot··on Can Bundler be as fast as uv?
You are describing bootsnap.

And yes I proposed to integrate bootsnap into bundler ages ago, but got told to go away.

byroot··on Can Bundler be as fast as uv?
> none of the providers really do this out of the box

CircleCI does. And I'm sure many others.

byroot··on Can Bundler be as fast as uv?
> My experience with GHA default caches is that it’s absolutely dog slow.

GHA is definitely far from the best, but it works:, e.g 1.4 seconds to restore 27 dependencies https://github.com/redis-rb/redis-client/actions/runs/205191...

> The only way docker caching works is if you have a persistent host.

You can pull the cache when the build host spawns, but yes, if you want to build efficiently, you can't use ephemeral builders.

But overall that discussion isn't very interesting because Buildkite is more a kit to build a CI than a CI, so it's on you to figure out caching.

So I'll just reiterate my main point: a CI system must provide a workable caching mechanism if it want to be both snappy and reliable.

I've worked for over a decade on one of the biggest Rails application in existence, and restoring the 800ish gems from cache was a matter of a handful of seconds. And when rubygems.org had to yank a critical gem for copyright reasons [0], we continued building and shipping without disruption while other companies with bad CIs were all sitting ducks for multiple days.

[0] https://github.com/rails/marcel/issues/23

byroot··on Can Bundler be as fast as uv?
GHA with the `setup-ruby` action will cache gems.

Buildkite can be used in tons of different ways, but it's common to use it with docker and build a docker image with a layer dedicated to the gems (e.g. COPY Gemfile Gemfile.lock; RUN bundle install), effectively caching dependencies.

byroot··on Can Bundler be as fast as uv?
Ye,s but if your CI isn't terrible, you have the dependencies cached, so that subsequent runs are almost instant, and more importantly, you don't have a hard dependency on a third party service.

The reason for speeding up bundler isn't CI, it's newcomer experience. `bundle install` is the overwhelming majority of the duration of `rails new`.

byroot··on Ruby 4.0.0
I know that tweet, it's real, but that doesn't contradict my comment.

They indeed replaced Unicorn by Falcon in one application, but falcon is configured in "Unicorn mode" (no concurrent requests). So the gain is effectively 0.

Also note how they don't share any performance metrics, contrary to https://railsatscale.com/2023-10-23-pitchfork-impact-on-shop...

byroot··on Ruby 4.0.0
> GC still stops the world, right?

Yes, Ractor local GC is the one feature that didn't make it into 4.0.

> Can't you just have completely separate boxes with their own copies of all classes etc, or does that use too much memory?

Ruby::Box is kinda complicated, and still need a lot of work, so it's unclear how the final implementation will be. Right now there is no CoW or any type of sharing for most classes, except for core classes.

Core classes are the same object (pointer) across all boxes, however they have a constant and method table for each box.

But overall what I meant to say is that Box wouldn't make GC any easier for Ractors.

byroot··on Ruby 4.0.0
They already truly run in parallel in Ruby 4.0. The overwhelming majority of contention points have been removed in the last yet.

Ruby::Box wouldn't help reducing contention further, they actually make it worse because with Ruby::Box classes and modules and an extra indirection to go though.

The one remaining contention point is indeed garbage collection. There is a plan for Ractor local GC, but it wasn''t sufficiently ready for Ruby 4.0.

byroot··on Ruby 4.0.0
> It seems Ractor is still work in progress

The Ractor experimental status could almost be removed. They no longer have known bugs, and only one noticeable performance issue left (missing Ractor local GC).

But the API was just recently changed, so I think it's better to wait another years.

> I vaguely remember reading Shopify is using Fiber / Rack / Async in their codebase.

Barely. There is indeed this management obsession for fibers even when it doesn't make sense, so there is some token usage there and there, but that's it.

There is one application that was converted from Unicorn to Falcon, but falcon isn't even configured to accept concurrent requests, the gain is basically 0.

As for Rails, there isn't much use cases for fibers there, except perhaps Active Record async queries, but since most users use Postgres and PG connections are extremely costly, few people are using AR async queries with enough concurrency for fibers to make a very noticeable difference.

byroot··on Programmers and software developers lost the plot on naming their tools
It was removed because rubygems was made to be required by default so it was now useless.

The stdlib still contains `un.rb` though: https://github.com/ruby/ruby/blob/d428d086c23219090d68eb2d02...

byroot··on Ruby Symbols
> They aren't interned frozen strings

Doesn't matter. The parent claim was:

> You'd just have a broken VM if you used mutable strings for metaprogramming in Ruby

From day one it was possible to freeze strings used in metaprograming. I mean Ruby Hashes do that to strings keys.

> Ruby 3.4 making it unnecessary because it is on by default.

That's incorrect: https://byroot.github.io/ruby/performance/2025/10/28/string-...

byroot··on Ruby Symbols
Ruby always had immutable (frozen) strings, so no, this never was a reason for Symbols existence.
byroot··on Ruby Symbols
HashWithIndifferentAccess was added because back in the day symbols were immortal, hence could not be used for request parameters.

It no longer make sense today, and any new use of it is a smell.

byroot··on Ruby Symbols
No they’re not.

String can be interned in Ruby, but it’s always possible for an equal string that is not interned to also exist. Hence interned strings can’t benefit from the same optimization than symbols.

You can first compare them by pointer, but on a mismatch you have to fallback to comparing content. Same for the hashcode, you have to hash the content.

byroot··on Compiling Ruby to machine language
Is it? Smaller business usually comes with smaller applications. Most cloud and hardware vendors give you about 4GiB of RAM per core, maybe only 2 when using "CPU optimized instances", that's huge and leave plenty of space for a couple hundred MB of JITed code.
Page 1 of 20Next →