htop VS rust-memchr

Compare htop vs rust-memchr and see what are their differences.

Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
getstream.io
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
htop rust-memchr
6 33
5,482 1,148
- 4.0%
1.2 6.0
over 4 years ago 29 days ago
C Rust
GNU General Public License v3.0 only The Unlicense
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

htop

Posts with mentions or reviews of htop. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-01.

rust-memchr

Posts with mentions or reviews of rust-memchr. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2025-06-14.
  • SIMD-friendly algorithms for substring searching
    6 projects | news.ycombinator.com | 14 Jun 2025
    The "AVX2 (generic)" approach is roughly what ripgrep uses (via Rust's `regex` crate) to accelerate most searches. Even something like `\w+\s+Sherlock\s+\w+` will benefit since ripgrep will pluck `Sherlock` out of the regex and search that.

    The actual implementation is here: https://github.com/BurntSushi/memchr?tab=readme-ov-file#algo...

    The main difference with the algorithm presented here is that instead of always using the first and last bytes of the needle, a heuristic is used to try to pick two bytes that occur less frequently according to a background frequency distribution.

    It ends up being quite a bit faster than just plain Two-Way or even GNU libc's implementation of `memmem`. From the root of the `memchr` repository:

        $ rebar rank benchmarks/record/x86_64/2023-12-29.csv -e '^rust/memchr/memmem/(oneshot|prebuilt|twoway)' -e '^libc/memmem/oneshot'
  • Show HN: Krep a High-Performance String Search Utility Written in C
    8 projects | news.ycombinator.com | 11 Mar 2025
    That's probably because pcmpestri is trash for substring search. There is a good reason why ripgrep doesn't use it. :-)

    I looked for an authoritative search for why pcmpestri is trash, and I couldn't find anything I was happy linking to other than Agner Fog's instruction tables: https://www.agner.org/optimize/instruction_tables.pdf You can see that the throughput and latency for pcmpestri is just awful.

    And yes, not having any code to print the matching lines means that the only code path in krep is just counting things. If that's all your tool is doing, you can totally beat ripgrep or any other tool that is more applicable to generalized use cases. It's why the `memchr` crate (what ripgrep uses for single substring search) has a specialized routine for counting occurrences of bytes (which ripgrep uses for line counting): https://github.com/BurntSushi/memchr/blob/746182171d2e886006...

    Because it's faster to do that than it is to reuse the generalized `memchr` API for finding the location of matching bytes.

    And counting matches in a multi-threaded context is way easier than actual managing the printing of matches in the same order that you get them.

    krep isn't big. You can skim its source code in a few minutes and get a good idea of how it works.

  • Regular Expression Matching Can Be Simple and Fast (2007)
    3 projects | news.ycombinator.com | 21 May 2024
    As the author of ripgrep, I wouldn't necessarily buy this. I suppose I might agree with it in the extremes, but SIMD prefilters are quite exceptionally difficult to beat with scalar code in the common cases. Longer patterns are great for the SIMD algorithms in ripgrep because of its use of background frequency distribution heuristics. That is, the longer the pattern, the less likely your candidate detection is to produce a false positive in its hot path.

    I don't mean to 100% disagree with you, but I think it's misleading to suggest a sort of one dimensional view of things where, as the pattern gets larger, SIMD gets worse compared to sublinear search algorithms. There are other factors at play here, and, importantly, what "long" means in this context.

    In many practical circumstances, "short" might be a few bytes, while "long" is 16 bytes. But maybe your idea of "long" is actually much longer.

    If you're curious how your own algorithm stacks up to ripgrep's, you can plug your implementation into the `memchr` crate's benchmark harness: https://github.com/BurntSushi/memchr

    It uses rebar: https://github.com/BurntSushi/rebar

  • Memchr: Optimized string search routines for Rust
    1 project | news.ycombinator.com | 13 Jan 2024
  • Ask HN: What's the fastest programming language with a large standard library?
    9 projects | news.ycombinator.com | 26 Dec 2023
    That's what the `memchr` crate does. It uses `vshrn` just like in your links. And vpmaxq before even bothering with vshrn: https://github.com/BurntSushi/memchr/blob/c6b885b870b6f1b9bf...
  • Rust-Cache
    1 project | news.ycombinator.com | 4 Dec 2023
    I agree with everything you said, but I don't see how it leads the OP's formulation being silly or wrong or not useful. Here's another example (of my own) where you can pick an upper bound for `n` and base your complexity analysis around it. In this case, we're trying to provide an API guarantee that a search takes O(m+n) time despite wanting to use an O(mn) algorithm in some subset of cases. We can still meet the O(m+n) bound by reasoning that the O(mn) algorithm is only used in a finite set of cases, and thus collapses to O(1) time. Therefore, the O(m+n) time bound is preserved. And this isn't a trick either. That really is the scaling behavior of the implementation. See: https://github.com/BurntSushi/memchr/blob/ce7b8e606410f6c81a...

    > If an algorithm is defined as being unscalable (fixed input), what sense does it make to describe that it scales constantly with input size?

    I'll answer your question with another: in what cases does it make sense to describe the scaling behavior of algorithm with O(1)?

  • Rust memchr adds aarch64 SIMD with impressive speedups
    1 project | news.ycombinator.com | 29 Aug 2023
  • Stringzilla: Fastest string sort, search, split, and shuffle using SIMD
    9 projects | news.ycombinator.com | 29 Aug 2023
  • Ripgrep now twice as fast on Apple Silicon with new aarch64 SIMD implementations
    1 project | news.ycombinator.com | 28 Aug 2023
  • Regex Engine Internals as a Library
    5 projects | news.ycombinator.com | 5 Jul 2023
    The current PR for ARM SIMD[1] uses a different instruction mix to achieve the same goals as movemask. I tested the PR and it has a significant speedup over the non-vectorized version.

    [1]https://github.com/BurntSushi/memchr/pull/114

What are some alternatives?

When comparing htop and rust-memchr you can also consider the following projects:

CodeTriage - Discover the best way to get started contributing to Open Source projects

duf - Disk Usage/Free Utility - a better 'df' alternative

NTop - 💻 htop-like system-monitor for Windows with Vi-keybindings.

thefuck - Magnificent app which corrects your previous console command.

xrdp - xrdp: an open source RDP server

bottom - Yet another cross-platform graphical process/system monitor.

Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
getstream.io
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured

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