HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
noamteyssier
hist-rs
Rust2025–2025
noamteyssier / hist-rs

hist-rs

An efficient unique-line counter (25x over `sort | uniq -c`)

2Distinct people
3Mentions
0Explicit recommenders
120GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

An efficient unique-line counter (25x over `sort | uniq -c`)

GitHub

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, 5:04:57 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 6-hour interval3 dated mentions

Observed mentions: 2025-10-22 22:26:45 UTC to 2025-10-27 12:41:00 UTC.

012025-10-22 18:00:00 UTC to 2025-10-23 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsOct 22, 18:002025-10-23 00:00:00 UTC to 2025-10-23 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-23 06:00:00 UTC to 2025-10-23 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-23 12:00:00 UTC to 2025-10-23 18:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2025-10-23 18:00:00 UTC to 2025-10-24 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-24 00:00:00 UTC to 2025-10-24 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-24 06:00:00 UTC to 2025-10-24 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-24 12:00:00 UTC to 2025-10-24 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-24 18:00:00 UTC to 2025-10-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-25 00:00:00 UTC to 2025-10-25 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsOct 25, 00:002025-10-25 06:00:00 UTC to 2025-10-25 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-25 12:00:00 UTC to 2025-10-25 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-25 18:00:00 UTC to 2025-10-26 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-26 00:00:00 UTC to 2025-10-26 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-26 06:00:00 UTC to 2025-10-26 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-26 12:00:00 UTC to 2025-10-26 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-26 18:00:00 UTC to 2025-10-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-27 00:00:00 UTC to 2025-10-27 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-27 06:00:00 UTC to 2025-10-27 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-27 12:00:00 UTC to 2025-10-27 18:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsOct 27, 12:00

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
Oct 22, 18:002025-10-22 18:00:00 UTC2025-10-23 00:00:00 UTC110
Oct 23, 00:002025-10-23 00:00:00 UTC2025-10-23 06:00:00 UTC000
Oct 23, 06:002025-10-23 06:00:00 UTC2025-10-23 12:00:00 UTC000
Oct 23, 12:002025-10-23 12:00:00 UTC2025-10-23 18:00:00 UTC110
Oct 23, 18:002025-10-23 18:00:00 UTC2025-10-24 00:00:00 UTC000
Oct 24, 00:002025-10-24 00:00:00 UTC2025-10-24 06:00:00 UTC000
Oct 24, 06:002025-10-24 06:00:00 UTC2025-10-24 12:00:00 UTC000
Oct 24, 12:002025-10-24 12:00:00 UTC2025-10-24 18:00:00 UTC000
Oct 24, 18:002025-10-24 18:00:00 UTC2025-10-25 00:00:00 UTC000
Oct 25, 00:002025-10-25 00:00:00 UTC2025-10-25 06:00:00 UTC000
Oct 25, 06:002025-10-25 06:00:00 UTC2025-10-25 12:00:00 UTC000
Oct 25, 12:002025-10-25 12:00:00 UTC2025-10-25 18:00:00 UTC000
Oct 25, 18:002025-10-25 18:00:00 UTC2025-10-26 00:00:00 UTC000
Oct 26, 00:002025-10-26 00:00:00 UTC2025-10-26 06:00:00 UTC000
Oct 26, 06:002025-10-26 06:00:00 UTC2025-10-26 12:00:00 UTC000
Oct 26, 12:002025-10-26 12:00:00 UTC2025-10-26 18:00:00 UTC000
Oct 26, 18:002025-10-26 18:00:00 UTC2025-10-27 00:00:00 UTC000
Oct 27, 00:002025-10-27 00:00:00 UTC2025-10-27 06:00:00 UTC000
Oct 27, 06:002025-10-27 06:00:00 UTC2025-10-27 12:00:00 UTC000
Oct 27, 12:002025-10-27 12:00:00 UTC2025-10-27 18:00:00 UTC101

What Hacker News says

3 sources
>I use nucgen to generate a random 100M line FASTQ file and pipe it into different tools to compare their throughput with hyperfine. This is a strange benchmark [0] -- here is what this random FASTQ looks like: $ nucgen -n 100000000 -l 20 | head -n8 >seq.0 TGGGGTAAATTGACAGTTGG >seq.1 CTTCTGCTTATCGCCATGGC >seq.2 AGCCATCGATTATATAGACA >seq.3 ATACCCTAGGAGCTTGCGCA There are going to be very few [*] repeated strings in this 100M line file, since each >seq.X will be unique and there are roughly a trillion random 4-letter (ACGT) strings of length 20. So this is really assessing the performance of how well a hashtable can deal with reallocating after being overloaded. I did not have enough RAM to run a 100M line benchmark, but the following simple `awk` command performed ~15x faster on a 10M line benchmark (using the same hyp
Read the rest
erfine setup) versus the naïve `sort | uniq -c`, which isn't bad for something that comes standard with every *nix system. awk '{ x[$0]++ } END { for(y in x) { print y, x[y] }}' <file> | sort -k2,2nr [0] https://github.com/noamteyssier/hist-rs/blob/main/justfile [*] Birthday problem math says about 250, for 50M strings sampled from a pool of ~1T.
In An overengineered solution to `sort | uniq -c` with 25x throughput (hist)

Show HN: hist: An overengineered solution to `sort|uniq -c` with 25x throughput

Was sitting around in meetings yesterday and remembered an old shell script I had to count the number of unique lines in a file. Gave it a shot in rust and with a little bit of (over-engineering)™ I managed to get 25x throughput over the naive approach using coreutils as well as improve over some existing tools. Some notes on the improvements: 1. using csv (serde) for writing leads to some big gains 2. arena allocation of incoming keys + storing references in the hashmap instead of storing owned values heavily reduced the number of allocations and improves cache efficiency (I'm guessing, I did not measure). There are some regex functionalities and some table filtering built in as well. happy hacking
4 points · Open discussion

An overengineered solution to `sort | uniq -c` with 25x throughput (hist)

Was sitting around in meetings today and remembered an old shell script I had to count the number of unique lines in a file. Gave it a shot in rust and with a little bit of (over-engineering)™ I managed to get 25x throughput over the naive approach using coreutils as well as improve over some existing tools. Some notes on the improvements: 1. using csv (serde) for writing leads to some big gains 2. arena allocation of incoming keys + storing references in the hashmap instead of storing owned values heavily reduced the number of allocations and improves cache efficiency (I'm guessing, I did not measure). There are some regex functionalities and some table filtering built in as well. happy hacking
118 points · Open discussion

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.