minitest-speed
Proof of concept speed tests using minitest.
A proof-of-concept Ruby gem that adds timed speed tests to minitest, letting developers measure how fast specific code runs and track performance trends over time.
minitest-speed is a proof-of-concept tool that lets Ruby developers measure how fast individual pieces of code run during their automated tests. It extends an existing testing framework called minitest by adding a new category of "speed tests" — tests that exist solely to be timed, rather than to check whether code produces the right answer.
When a developer writes a speed test, they define a test method that performs whatever operation they want to measure. Running the tests with a specific environment flag (SPEED=1) executes only the speed tests and prints out timing data for each one. Without that flag, the speed tests are skipped and only regular tests run. The idea is that if you save those timing results over time, you can graph them and spot trends — like a particular operation getting slower as the codebase grows.
This would appeal to developers who care about performance and want to catch regressions early. For example, if someone's building an API and wants to track how long a database query or data-parsing routine takes across dozens of code changes, they could use this to keep an eye on it. The timing data could be collected each time tests run and compared week over week.
The project is explicitly a proof of concept and the author warns it's not intended for production use in its current form. It works, but it's more of an experiment than a polished tool. The README doesn't go into detail about what's missing or what would need to change before it could be relied on for real projects — it simply shows the basic mechanism of defining and running a timed test.
Given that it has only a handful of stars and is labeled as experimental, anyone considering it should understand it's more of a starting point or inspiration than something ready to drop into a real codebase.
Where it fits
- Track how long a database query takes across code changes over time.
- Monitor data-parsing routine speed to catch performance regressions early.
- Run speed tests separately from regular tests to collect timing data for trend analysis.