HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
SamSaffron
fast_blank
Ruby2015–2016
SamSaffron / fast_blank

fast_blank

Discover this repository through its Hacker News conversations.

4Distinct people
4Mentions
0Explicit recommenders
613GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month4 dated mentions

Observed mentions: 2015-09-29 14:49:50 UTC to 2016-07-10 07:16:00 UTC.

012015-09-01 00:00:00 UTC to 2015-10-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsSep 20152015-10-01 00:00:00 UTC to 2015-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-11-01 00:00:00 UTC to 2015-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-12-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2016-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-02-01 00:00:00 UTC to 2016-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsFeb 20162016-03-01 00:00:00 UTC to 2016-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-04-01 00:00:00 UTC to 2016-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-05-01 00:00:00 UTC to 2016-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-06-01 00:00:00 UTC to 2016-07-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-07-01 00:00:00 UTC to 2016-08-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJul 2016

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Sep 20152015-09-01 00:00:00 UTC2015-10-01 00:00:00 UTC101
Oct 20152015-10-01 00:00:00 UTC2015-11-01 00:00:00 UTC101
Nov 20152015-11-01 00:00:00 UTC2015-12-01 00:00:00 UTC000
Dec 20152015-12-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
Jan 20162016-01-01 00:00:00 UTC2016-02-01 00:00:00 UTC000
Feb 20162016-02-01 00:00:00 UTC2016-03-01 00:00:00 UTC000
Mar 20162016-03-01 00:00:00 UTC2016-04-01 00:00:00 UTC000
Apr 20162016-04-01 00:00:00 UTC2016-05-01 00:00:00 UTC000
May 20162016-05-01 00:00:00 UTC2016-06-01 00:00:00 UTC000
Jun 20162016-06-01 00:00:00 UTC2016-07-01 00:00:00 UTC101
Jul 20162016-07-01 00:00:00 UTC2016-08-01 00:00:00 UTC101

What Hacker News says

4 sources
I guess that was the key takeaway from your talk: Ignore local optimisations in favour of more global ones. The fact that you parse C extensions was really unexpected. Given something like Object#blank? using the Ruby implementation vs Sam Saffron's "fast_blank", after JRuby+Truffle has done it's work, which implementation ends up more performant? And would a future JRuby+Truffle (given both the Ruby and C implementation) make an intelligent decision of which one to use? https://github.com/SamSaffron/fast_blank
In Why it's important to optimise the tricky parts of Ruby [video]
> Rust can use simd too. No it can't. Either accept that the nightly build of Rust is not the Rust we are talking about or stop discussing with me. > Re:regex: my point exactly. The problem with regex libraries are that they are to big so therefore doesn't reveal so much about inherent language performance. > Most microbenchmarks are prone to slight differences in the implementation causing issues (and you can rarely translate code exactly, especially to something like rust which often requires a different structure of code from C. Same for any two other langauges). Yes, obviously the implementation defines performance. That's what I wrote in the other thread part: "this discussion is about Rust vs C. Or rather clang 3.6.2/gcc 5.2.1 vs Rust 1.9.0 since language performance is very implementation dependent" And fwiw, you can easily transli
Read the rest
terate C code to C++ or to asm. > 19% is well within this error box. What error box? 19% is a huge difference. > The fast_blank thing is this example. fast_blank is a carefully hand optimized C extension whose main purpose is being super fast. I don't know what fast_blank is. Is it this https://github.com/SamSaffron/fast_blank/blob/master/ext/fas... C code wycatz managed to rewrite faster in Rust? That C code isn't well-optimized at all... > I don't put much stock in microbenchmarks for anything other than order of magnitude comparisons. Does that mean it is impossible to prove to you that C is at least 2x faster than Rust since twice is less than one order of magnitude?
In Why Rust for Low-Level Linux Programming?
If you don't want to invest in a two-hour long video: TL;DR: Rails has a library, `ActiveSupport`, which adds methods to Ruby core classes. One of those methods is `String#blank?`, which returns a boolean (sometimes I miss this convention in Rust, the `?`) if the whole string is whitespace or not. It looks like this: https://github.com/rails/rails/blob/b3eac823006eb6a346f88793... It's pretty slow. So Discourse (which you may know from {users,internals}.rust-lang.org) uses the [`fast_blank`](https://rubygems.org/gems/fast_blank) gem, which provides this method via a C implementation instead. It looks like this: https://github.com/SamSaffron/fast_blank/blob/master/ext/fas... For fun, Yehuda tried to re-write `fast_blank` in Rust. Which looks like this: extern crate libc; mod buf; // a small buffer struct + impl, not shown use bu
Read the rest
f::Buf; #[no_mangle] pub extern "C" fn tr_str_is_blank(b: Buf) -> bool { let s = b.as_slice().unwrap(); s.chars().all(|c| c.is_whitespace()) } Turns out, this implementation ends up being faster than that C one, while also being significantly more straightforward. This video is a two-hour dive into why that is.
In Using Rust with Ruby, a Deep Dive with Yehuda Katz

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.