Instructor Lead On-Demand Learning Courses - August Big $10 Sitewide Extravaganza All Pro Web Designs and Udemy are happy to offer this special to you, good only on dates: 08/21-08/31 Act Now!

Ruby Can Be Faster with a Bit of Rust

rusy

In spring of 2013, Sam Saffron committed fast_blank to GitHub. It was a C extension that provided a fast drop-in alternative to ActiveSupport’s String#blank? method which returns whether a string is nothing but whitespace.

At Full Stack Fest 2015, Yehuda Katz presented a talk where he described his investigation into rewriting fast_blank in Rust. His initial goal was to try a naive one-liner (excluding his implementation of Buf) and see how much slower it was than the original C extension.

extern "C" fn fast_blank(buf: Buf) -> bool {
  buf.as_slice().chars().all(|c| c.is_whitespace())
}

To his surprise, it was faster.

Continue reading %Ruby Can Be Faster with a Bit of Rust%

Instructor Lead On-Demand Learning Courses - August Big $10 Sitewide Extravaganza All Pro Web Designs and Udemy are happy to offer this special to you, good only on dates: 08/21-08/31 Act Now!

Leave a Reply