frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

How I Made Ruby Faster Than Ruby

https://noteflakes.com/articles/2025-08-18-how-to-make-ruby-faster
43•ciconia•1d ago

Comments

swombat•4h ago
Feels like a misleading headline. The author created another templating language alternative to ERB, found that it was slower than ERB, then optimise it until it was roundabout as fast as ERB given a relatively simple template.

The author then appears to draw the wrong conclusion:

> What I find most interesting about the changes I’ve made to code generation in P2, is that the currently compiled code is more than twice as fast as it was when P2 first came out, which just goes to show than in fact Ruby is not slow, it is actually quite fast, you just need to know how to write fast code! (And I guess this is true for any programming language.)

I love Ruby, but it is still a slow language on most benchmarks. That's ok. For most webapps, the bottleneck is not execution-time performance, it's the speed and joy of writing the code. Functionality that never got built because it was too annoying to build is infinitely slow. But there's no point in pretending Ruby, compared to, say, Rust, isn't a slow-as-molasses execution environment. It is. It's ok. It's optimised for developer happiness, not speed.

And yes, even so, you can write slow Ruby code and fast Ruby code. Again, which one makes sense is contextual. But it doesn't make the point that "Ruby isn't slow."

barrkel•4h ago
Ruby is slow, but it is however faster than Python last I checked, with like for like code.

Python gives you other interesting ways of going fast (a lot of high performance plugins for numerics, Cython, and so on), while Ruby is a higher level more expressive language IMO, so you have more ways to shoot yourself in the foot more powerfully.

Asmod4n•3h ago
Depends how you use it, just last week I’ve hit 40 nanoseconds unpacking a 8 megabyte msgpack array and accessing one of its values in a hash.

As long as you only use ruby as glue code for c(++) extensions it’s pretty fast.

norman784•3h ago
AFAIK with the latest JIT in some contexts pure Ruby can be faster than using C libraries, just because the VM can be better optimized and there is no overhead in moving data between the two realms.

I don't recall exactly where I read it, but I think was a while ago when they announced one of the newest JIT engines.

ciconia•3h ago
Hi, author here. Taking your argument to its logical conclusion we can say that it doesn't matter if your Ruby code is slower or faster because it's Ruby, we know it's "slow-as-molasses", we only care about developer happiness, and anyways we're I/O-bound, so it doesn't really matter how our code performs...

But in my experience it does. I've built platforms in Ruby that handle north of 1K reqs/sec with bursts of 10K reqs/sec on moderate hardware, without needing to setup a whole cluster of machines that crunch on poorly-performing code.

From my experience, getting the average execution time per render from say 0.1ms to 0.01ms, and especially reducing allocations and GC pressure has a big effect on 99% percentiles, and consequently on the cost of compute.

Saying because we use Ruby we don't care if it's slow or not is in a way dismissing it as a viable platform for writing reliable software (because performance is part of reliability).

To me, you can use Ruby to create systems that have very good performance characteristics, and still benefit from developer happiness. The two are not contradictory.

makeitdouble•3h ago
> Taking your argument to its logical conclusion we can say that it doesn't matter if your Ruby code is slower or faster because it's Ruby, we know it's "slow-as-molasses", we only care about developer happiness, and anyways we're I/O-bound, so it doesn't really matter how our code performs...

Not OP, but to a point I think this is pretty much true...

We currently have decent performance so it works out well for most use cases, but if Ruby were to be slower, we could probably cover that issue with infra, caching or other means. As we already do in many cases.

It would be a pain point, but in comparison increasing developer happiness or the whole product dev experience is IMHO a lot harder. Perfs would need to be abysmally bad to change that balance.

Lio•1h ago
Yep, I agree with this.

Jean Boussier wrote this execellent examination of CPU bound Rails application and why making use of multi-processes is probably a good idea.

Even if you're not using CPU bound it's still daft to leave performance on the table you don't need to.

For the most part if something is a bit slower than it needs to be it still makes more sense to take the obvious bottle necks out before you rewrite the whole system in another language. Especially with YJIT and forcoming ZJIT availible.

1. https://byroot.github.io/ruby/performance/2025/01/23/the-myt...

Sincere6066•1h ago
yo dawg meme? I think that meme's old enough to drink now
spauldo•1h ago
I like it, as memes go. My personal favorite:

Yo dawg, I heard yo and yo dawg like yo-yos so I put yo dawg in yo yo-yo so yo can yo-yo yo dawg while yo dawg yo-yos, dawg.

AGENTS.md – Open format for guiding coding agents

https://agents.md/
522•ghuntley•10h ago•234 comments

How to Think About GPUs

https://jax-ml.github.io/scaling-book/gpus/
115•alphabetting•1d ago•27 comments

Ask HN: Why does the US Visa application website do a port-scan of my network?

168•mbix77•4h ago•69 comments

How to Draw a Space Invader

https://muffinman.io/blog/invaders/
320•abdusco•11h ago•36 comments

Modern CI Is Too Complex and Misdirected

https://gregoryszorc.com/blog/2021/04/07/modern-ci-is-too-complex-and-misdirected/
81•thundergolfer•6h ago•37 comments

Copilot broke audit logs, but Microsoft won't tell customers

https://pistachioapp.com/blog/copilot-broke-your-audit-log
507•Sayrus•10h ago•175 comments

How we exploited CodeRabbit: From simple PR to RCE and write access on 1M repos

https://research.kudelskisecurity.com/2025/08/19/how-we-exploited-coderabbit-from-a-simple-pr-to-rce-and-write-access-on-1m-repositories/
599•spiridow•18h ago•201 comments

Tiny microbe challenges the definition of cellular life

https://nautil.us/a-rogue-new-life-form-1232095/
100•jnord•11h ago•23 comments

D2 (text to diagram tool) now supports ASCII renders

https://d2lang.com/blog/ascii/
319•alixanderwang•16h ago•52 comments

Type-machine

https://arthi-chaud.github.io/posts/type-machine/
23•todsacerdoti•5h ago•4 comments

How I Made Ruby Faster Than Ruby

https://noteflakes.com/articles/2025-08-18-how-to-make-ruby-faster
43•ciconia•1d ago•9 comments

The Value of Hitting the HN Front Page

https://www.mooreds.com/wordpress/archives/3530
93•mooreds•8h ago•38 comments

Gaussian Processes for Machine Learning [pdf]

https://gaussianprocess.org/gpml/chapters/RW.pdf
27•susam•1d ago•5 comments

Show HN: I've made an easy to extend and flexible JavaScript logger

https://github.com/inshinrei/halua
4•inshinrei•21h ago•3 comments

Emacs as your video-trimming tool

https://xenodium.com/emacs-as-your-video-trimming-tool
243•xenodium•18h ago•124 comments

Fast and observable background job processing for .NET

https://github.com/mikasjp/BusyBee
16•mikasjp•2d ago•5 comments

Customizing Lisp REPLs

https://aartaka.me/customize-repl.html
14•nemoniac•1d ago•2 comments

Candle Flame Oscillations as a Clock

https://cpldcpu.com/2025/08/13/candle-flame-oscillations-as-a-clock/
291•cpldcpu•4d ago•65 comments

Without the futex, it's futile

https://h4x0r.org/futex/
269•eatonphil•20h ago•124 comments

Rails Charts Using ECharts from Apache

https://github.com/railsjazz/rails_charts
45•amalinovic•2d ago•4 comments

Intel Foundry Demonstrates First Arm-Based Chip on 18A Node

https://hothardware.com/news/intel-foundry-demos-deer-creek-falls-reference-soc
45•rbanffy•1d ago•21 comments

CRDT: Text Buffer

https://madebyevan.com/algos/crdt-text-buffer/
121•skadamat•14h ago•6 comments

AnduinOS

https://www.anduinos.com/
129•TheFreim•15h ago•160 comments

Drunken Bishop (2023)

https://re.factorcode.org/2023/08/drunken-bishop.html
67•todsacerdoti•12h ago•12 comments

How Figma’s multiplayer technology works (2019)

https://www.figma.com/blog/how-figmas-multiplayer-technology-works/
150•redbell•3d ago•48 comments

We’re Not So Special: A new book challenges human exceptionalism

https://democracyjournal.org/magazine/78/were-not-so-special/
74•nobet•7h ago•143 comments

Show HN: OpenAI/reflect – Physical AI Assistant that illuminates your life

https://github.com/openai/openai-reflect
77•Sean-Der•14h ago•29 comments

Custom telescope mount using harmonic drives and ESP32

https://www.svendewaerhert.com/blog/telescope-mount/
287•waerhert•1d ago•105 comments

Show HN: Hanaco Weather – A poetic weather SNS from the OS Yamato project

https://github.com/osyamato/os-yamato
12•tsuyoshi_k•6h ago•5 comments

Why Semantic Layers Matter (and how to build one with DuckDB)

https://motherduck.com/blog/semantic-layer-duckdb-tutorial/
132•secondrow•17h ago•29 comments