RSSAmplifier

Blog

Adrian Alic's Blog

alic.devhRSS feed ↗4 posts

Latest posts

When Zig Outshines Rust - Memory Efficient Enum Arrays

Proper support for sum types or tagged unions have become table stakes for systems programming languages. However, they can incur a lot of memory fragmentation that's not trivial to avoid without good support for metaprogramming. This post goes into Zig's powerful comptime feature, and how it allows some radical approaches to efficient data structure design.

Beating the Fastest Lexer Generator in Rust

In this post I take a look at a popular Rust crate for generating lexers called logos. One of its goals is to compile regex specifications down to a jump-table FSM that is supposedly faster than anything you'd write by hand. This claim nerd-sniped me into writing a hand-rolled SIMD lexer, against which I'll put logos to the test.

On Custom-Width Integer Types

Custom-width integers are an interesting language feature. They open the door to several efficiency optimizations - both in hardware and software. In this post I'll be making an argument in favor of custom-width integers, and why modern systems programming languages should absolutely have them.

Measuring the Impact of False Sharing

I recently began writing a bounded, wait-free MPSC queue in Rust. A very common advice for ring-buffer based implemenations is to prevent the tails and heads from mapping to the same cache line. In this article, I would like to find out the concrete performance penalty of false sharing for my data structure by performing tests on both ARM (Apple Silicon) and x86 (Intel/AMD) processors.