Good example of high performance Rust project without unsafe code?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • Symphonia

    Pure Rust multimedia format demuxing, tag reading, and audio decoding library

  • I currently use Symphonia for audio decoding, and they claim to have similar performance as FFmpeg using only safe Rust code. There's not many reasons why safe Rust code should have worse performance than similar C or C++ code, but you have to be careful to compare apples with apples, for example regarding string handling, regex, file handling etc.

  • json-benchmark

    nativejson-benchmark in Rust

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • tiny-skia

    A tiny Skia subset ported to Rust

  • How about tiny-skia? Almost the same performance as C, no unsafe, a lot of explicit SIMD.

  • ttf-parser

    A high-level, safe, zero-allocation TrueType font parser.

  • Or even ttf-parser, which is usually even faster than C alternatives, no unsafe, no explicit SIMD.

  • safety-dance

    Auditing crates for unsafe code which can be safely replaced

  • According to the rust-secure-code/safety-dance trophy case, their audit left miniz_oxide 100% safe and faster than the C version.

  • FFmpeg

    Mirror of https://git.ffmpeg.org/ffmpeg.git

  • I currently use Symphonia for audio decoding, and they claim to have similar performance as FFmpeg using only safe Rust code. There's not many reasons why safe Rust code should have worse performance than similar C or C++ code, but you have to be careful to compare apples with apples, for example regarding string handling, regex, file handling etc.

  • gearley

    An Earley parser engine in Rust.

  • RUST: https://github.com/pczarn/gearley

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • yaep

    Yet Another Earley Parser

  • fast-float-rust

    Super-fast float parser in Rust (now part of Rust core)

  • I'd like the mention my own refactoring of fast-float-rust to remove nearly all unsafe code for merging into Rust core library which left the performance identical to the previous implementation.

  • rust

    Empowering everyone to build reliable and efficient software.

  • I'd like the mention my own refactoring of fast-float-rust to remove nearly all unsafe code for merging into Rust core library which left the performance identical to the previous implementation.

  • miniz_oxide

    Rust replacement for miniz

  • miniz_oxide is slightly faster than zlib

  • image-gif

    GIF en- and decoder

  • gif, png, zune-jpeg are on par with their C counterparts in terms of performance

  • image-png

    PNG decoding and encoding library in pure Rust

  • gif, png, zune-jpeg are on par with their C counterparts in terms of performance

  • zune-jpeg

    Discontinued A jpeg decoder with wings

  • gif, png, zune-jpeg are on par with their C counterparts in terms of performance

  • resvg

    An SVG rendering library.

  • resvg is very fast, although the performance depends on the exact SVG you feed it - sometimes faster than librsvg, sometimes slower (although librsvg is also written in Rust now, it does use unsafe while resvg doesn't)

  • cv

    Rust CV mono-repo. Contains pure-Rust dependencies which attempt to encapsulate the capability of OpenCV, OpenMVG, and vSLAM frameworks in a cohesive set of APIs.

  • Rust can absolutely be used without unsafe to create some of the fastest code out there, but you need to try and use data-oriented design where possible to make things flow smoothly and avoid runtime checks. The hardest thing to use data-oriented design for, in my opinion, is graphs. I find that actor systems can be used instead of graphs, but it is difficult. Generally I end up using slotmap to make multiple arenas and then putting them into one large object with lots of methods to operate on the graph structure. If you want an example of that, this is probably the most complicated code I have made this way: https://github.com/rust-cv/cv/blob/511024feaa077a9af377cca7b654ad3d57d3bd6a/cv-sfm/src/lib.rs. It may not be entirely helpful to understand the whole codebase, but if you are curious to see how I do graphs in Rust with slotmap, this can be a good reference.

  • simple-simd

    Simple SIMD types for Rust, primarily for x86 AVX2

  • Good point, I don't know the answer to this. What I ended up doing was creating my own "safe" wrappers for the AVX2 instructions (which is basically what you want to use for x86). There are other crates that provides safe interfaces, but they didn't really fit my needs.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
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

  • FFmpeg 7.0 Released

    11 projects | news.ycombinator.com | 4 Apr 2024
  • Docker ARMv7 Alpine Rust builder

    5 projects | /r/rust | 7 May 2023
  • Add the metadata displayed in the Library to the actual video file

    1 project | /r/kodi | 26 Oct 2022
  • Debate entre candidatos a governador - hoje às 21h na Band

    2 projects | /r/saopaulo | 8 Aug 2022
  • ffmpeg port in Rust.

    3 projects | /r/rust | 4 Aug 2022