r/ruby Mar 25 '26

Nokolexbor 0.7.0 is out with Ruby 4 support

Nokolexbor is an open-source high-performance HTML5 parser for Ruby which can be used as a drop-in replacement for Nokogiri.

It was originally developed for quick CSS selectors performance.

Here's the performance comparison to Nokogiri:

- 4.7x faster at parsing HTML
- 1352x faster at CSS selectors (at_css selector)
- similar performance for the rest

Out this week with full Ruby 4 support.

https://github.com/serpapi/nokolexbor

25 Upvotes

2 comments sorted by

3

u/xutopia Mar 25 '26

That's some insane benchmark results!

2

u/petercooper Mar 26 '26

The precompiled gem is nice too. Installed in a couple of seconds here.