MLabs Publications

The many minds at MLabs present news, case studies, editorials, tutorials, whitepapers, Cardano Catalyst proposals, and more.

Haskell, Optimisations Koz Ross Haskell, Optimisations Koz Ross

First Know Thy Self: Understanding String Matching Performance With ASCII

In this post, we explore the performance characteristics of string matching in ASCII text, comparing brute force, Boyer-Moore-Horspool, and DAWG-based approaches. You'll learn how benchmarking, algorithmic analysis, and practical implementation tradeoffs intersect—revealing when optimizations help, when they hurt, and how understanding your tools leads to better real-world performance.

Read More
Cardano, Optimisations Koz Ross Cardano, Optimisations Koz Ross

Do You Even PLift? Bridging Haskell & Plutarch with PLiftable for Efficient On-Chain Data

In this post, discover how PLiftable seamlessly translates Haskell types into Plutarch terms, giving you clear, efficient on-chain data representations. We’ll walk through builtin, SOP, and Data encodings—showing you how to write reversible, performant conversions that boost the reliability and performance of your Cardano scripts.

Read More
Haskell, Optimisations Koz Ross Haskell, Optimisations Koz Ross

The 'A' is for 'Accelerated': Checking ASCII with SWAR

In this post, discover how to push Haskell’s performance boundaries by using SWAR (“SIMD Within A Register”) techniques to validate ASCII data in bulk. You’ll see how packing bytes into registers—using bit masking to flag non-ASCII values in parallel—and unrolling loops to leverage the CPU’s superscalar engine both drive down overhead. By the end, we'll transfer a simple foldl'-based ASCII detecting function into a version running 10x faster.

Read More