How we made a Ruby method 200x faster

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. nokolexbor

    High-performance HTML5 parser for Ruby based on Lexbor, with support for both CSS selectors and XPath.

    You can also switch to Nokolexbor, our drop-in replacement for Nokogiri: https://github.com/serpapi/nokolexbor

    It should almost 1,000 faster for this kind of CSS lookups.

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. HTML::Pipeline

    HTML processing filters and utilities

    You may also be interested in https://github.com/gjtorikian/html-pipeline (or its main dependency, https://github.com/gjtorikian/selma), for high performance HTML manipulation.

  4. selma

    Selma selects and matches HTML nodes using CSS rules. Backed by Rust's lol_html parser. (by gjtorikian)

    You may also be interested in https://github.com/gjtorikian/html-pipeline (or its main dependency, https://github.com/gjtorikian/selma), for high performance HTML manipulation.

  5. Nokogiri

    Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.

    (2.1) Compare tagName in the selector

    Apparently Nokogiri implements CSS in a very inefficient way though by collecting ancestors and then converting the CSS into xpath and matching that:

    https://github.com/sparklemotion/nokogiri/blob/e8d30a71d70b2...

    https://github.com/sparklemotion/nokogiri/blob/e8d30a71d70b2...

    I'd expect that to be an order of magnitude slower than what a browser does.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Comparable maintained Kimurai alternative?

    1 project | /r/ruby | 4 Jun 2022
  • In "Your Name" (2016), Mitsuha and Tesshi are seen turning a tree into their makeshift café, which is why one of the trees in the town is later missing

    1 project | /r/MovieDetails | 20 May 2022
  • Nokogiri 1.12 supports HTML5 parsing (after assimilating Nokogumbo)

    1 project | /r/ruby | 4 Aug 2021
  • Error when creating a new project

    1 project | /r/rails | 1 Mar 2021
  • How efficient is the Xml filter plugin with large files?

    2 projects | /r/elasticsearch | 16 Feb 2021

Did you know that Ruby is
the 12th most popular programming language
based on number of references?