Sign in to confirm you’re not a bot
This helps protect our community. Learn more
Comments are turned off. Learn more
Blazing-Fast Directory Tree Traversal: Haskell Streamly Beats Rust by Harendra Kumar #FnConf 2025
47Likes
1,512Views
Jan 282025
Haskell is a high-level, safe programming language often misunderstood as lacking performance when compared to lower-level languages like C and Rust. Many believe Haskell is unsuitable for systems programming due to these performance concerns. In this talk, we will present a real-world use case that demonstrates how Haskell can not only provide a concise, practical application but also outperform low-level languages like Rust in terms of execution speed. We will use the Haskell Streamly programming framework to implement a recursive file system directory tree traversal, printing the entire directory structure. The core of the program is just a few lines of code, showcasing the conciseness and elegance of Haskell. We will demonstrate how the program can be written in various ways to suit different user requirements, such as implementing a breadth-first search (BFS) or depth-first search (DFS). The same program can also run in either a serial or concurrent manner with no changes to the underlying structure. We will compare the performance of this Haskell program to the Rust "fd" utility, which is known as the fastest directory traversal tool, outperforming traditional tools like GNU ls and find. On a two-CPU system, we found that the non-concurrent version of our Haskell program performs at the same level as the concurrent version of the Rust program when traversing a directory tree with 60,000 files. Moreover, the concurrent version of the Haskell program is 1.5 times faster than the concurrent version of the Rust "fd" utility.   More details: https://confengine.com/conferences/fu... Conference Link: https://functionalconf.com
How this content was made
Auto-dubbed
Audio tracks for some languages were automatically generated. Learn more

Follow along using the transcript.

ConfEngine

14.1K subscribers