All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Using In-Memory Filesystems for Faster File Management Testing in Rust

By

ingve

9mo ago· 5 min readen

Summary

The author discusses their experience with file management testing in Rust CLI tools, specifically addressing performance issues with file operations (exec and fstat) that slow down test suites. They explore using in-memory filesystems as a solution, inspired by the Go package Afero, and seek Rust equivalents to replace std::fs with a custom filesystem implementation for faster testing.

Key quotes

· 4 pulled
I have written a lot of file management tests for Bundler, and the two biggest reasons that the Bundler test suite is slow are exec and fstat.
Knowing that, I thought I would try to get out ahead of the slow file stat problem by using an in-memory filesystem for testing.
A collaborator mentioned being happy with the Go package named Afero for this purpose, and so I set off to look for a Rust equivalent to Afero.
Conceptually, I was hoping to be able to replace std::fs:: with mycli::fs::
Snippet from the RSS feed
I’ve been working on a CLI tool recently, and one of the things it does is manage files on disk. I have written a lot of file management tests for Bundler, and the two biggest reasons that the Bundler test suite is slow are exec and fstat. Knowing that, I

You might also wanna read