September 27, 2026
ttfx moves optimizations to Rust: draft is 25% faster than asm
On Sep 27, ttfx's draft Rust code was on average 1.25 times faster than asm. It retains optimizations for AVX-512, AVX2, SSE2, and Neon.

DHH
@dhh
Daniel is working magic on a Rust version of ttfx's asm improvements with CPU-specific optimizations. Love it! I do not care what code my agents wrote. These are exactly the kinds of technical challenges I can get absorbed in 😄🤘
WIP but ~10.7x faster than the original Rust code and 1.25x faster than the asm version on average. Still written in Rust with AVX-512/AVX2/SSE2/Neon opts https://github.com/omacom/ttfx/pull/44
· 14.4K views
Previously, ttfx accelerated effects with an asm engine. The new draft brings those optimizations back to Rust.
On Sep 26, v0.4.0 added asm for all 37 effects. On a Ryzen 9 9955HX, that engine was 9.8 times faster than the previous Rust code and 322 times faster than TerminalTextEffects 0.15.0 on CPython 3.14.7. The new draft already shows a 10.7x gain over the original Rust code.
How it works. On x86-64, ttfx automatically selects the CPU-specific version from SSE2 through AVX-512. On other architectures and without NASM, it falls back to Rust. asm builds on x86_64 Linux require NASM 3.0 or newer from `$NASM` or `PATH`; otherwise, the build warns and produces a pure-Rust binary. `TTFX_ASM_SHOW_TIER=1` shows the selected engine, `TTFX_ASM=0` disables asm, `TTFX_ASM=force` requires it and exits with code 3 if unavailable, while `TTFX_ASM_TIER=n` pins the CPU-specific version.
Build and run. Build the current version with: - `git clone https://github.com/omacom-io/ttfx.git` - `cd ttfx` - `cargo build --release`
Run check: `git log --oneline -10 | ./target/release/ttfx matrix`. The CLI accepts piped input, for example `ls -la | ttfx decrypt`, shows help with `ttfx <effect> --help`, and generates completions for bash and zsh. The 9.8x benchmark used a 200×50 canvas with 190×46 text, no frame-rate limit, output redirected to `/dev/null`, and the best result from 3–5 runs.
PR #40 ports the asm engine to aarch64 Linux: on an Apple M3, it reports a 5.7x gain over Rust for 32 of 37 effects.
Source
