TL;DR
Get school and study supplies delivered free — and shop member deals
- Fast, free delivery on millions of items
- Access to Prime Big Deal Days deals on October 6–7
- Prime Video, Amazon Music and more included
In an Oct. 5, 2026, post, software developer matklad recommends tuning microbenchmark workloads to run for about 300 milliseconds. The guideline is a personal rule of thumb intended to make results easier to interpret and repeat quickly, not a claim that this duration produces a universally precise measurement.
Software developer matklad recommended running microbenchmarks for about 300 milliseconds in a post published Oct. 5, 2026, arguing that the duration offers a practical balance between readable timing results, reduced influence from fixed overhead and quick repetition. The recommendation is a personal rule of thumb, not a benchmark standard or a claim that 300 milliseconds guarantees precise measurements.
Matklad says they adjust a benchmark’s input size until a single run takes about 300ms. The goal, as described in the post, is to support engineering decisions by giving the person optimizing software enough intuition to judge whether a change is useful, rather than treating every benchmark as a precise performance measurement.
The post argues that millisecond-scale results are easy to scan and compare without switching between units or decimal formats, such as seconds and milliseconds. It also cautions that tests taking less than about 10ms can be affected by fixed costs, including interpreter startup. Runs lasting hundreds of milliseconds, the author says, can make one-off overhead less prominent without requiring more elaborate techniques to account for it.
There is a trade-off at the other end: runs lasting more than a second slow down repeated testing. Matklad says running a benchmark 10 times in succession to inspect variation should remain quick. A few hundred milliseconds also falls within a range a person can perceive, which the author says helps build an intuitive sense of speed during optimization.
A Practical Balance for Repeated Tests
The recommendation focuses on the everyday decisions developers make while optimizing a program: whether a change appears to improve performance, whether the result is stable enough to trust, and whether it is practical to run the test repeatedly. A benchmark that finishes too quickly may give fixed overhead more influence; one that takes too long can make experimentation cumbersome.
Matklad’s proposed 300ms target is meant to sit between those problems. It may be useful for developers who want a simple starting point when setting workload size, particularly for command-line tools and other code where a change can be experienced directly. The author describes the perceptible difference between a lagging command and one that feels “instant” as part of the appeal of optimization.
The advice is not a substitute for defining what a benchmark is meant to measure. Different programs and testing environments may have different overheads, and the post does not present comparative experiments showing that 300ms is best across them. Its value is as a stated working heuristic, with the underlying aim of informing a decision rather than producing a definitive performance figure.
As an affiliate, we earn on qualifying purchases.
The Oct. 5 post begins with a practical question: how long should a microbenchmark run? Matklad answers with a rule used in their own work—adjust the input until the benchmark takes around 300ms—and explains the reasoning in terms of readability, fixed costs, human perception and iteration speed.
The recommendation sits between two concerns identified by the author. Very short tests may be distorted by costs that are not the operation being studied, while substantially longer tests take more time to repeat. The post argues that hundreds of milliseconds are long relative to a computer’s ordinary operations but short enough for a person to rerun tests and compare outcomes without a lengthy wait.
Matklad frames this as a way to build enough intuition for a correct optimization decision. The post does not offer a formal testing protocol, specify a required number of repetitions beyond giving 10 runs as an example, or claim that every benchmark should use the same duration.
“My rule of thumb is to tweak the input size until the benchmark takes about 300ms.”
— Matklad, in the Oct. 5, 2026, post
Where the 300ms Rule May Vary
The post does not report experiments comparing different benchmark durations, quantify how much fixed overhead affects tests below 10ms, or establish 300ms as a universal threshold. It also does not specify the hardware, runtime, benchmark framework or measurement method behind the recommendation.
Those details matter because a benchmark’s purpose and environment can affect how long it should run and what sources of variation it needs to address. The author presents the timing target as personal practice, not evidence that a 300ms run is statistically reliable in every setting. Readers should treat the proposed duration as a starting point and judge whether it fits the workload they are measuring.
Apply the Rule to the Workload
The post does not announce a formal follow-up, new tool or planned testing standard. Its practical next step for readers is to adjust a benchmark’s input size and see whether a run of roughly 300 milliseconds makes results easy to compare and repeat for the task at hand.
Developers using the heuristic would still need to decide what they want to measure and whether fixed costs or run-to-run variation affect the result. Matklad’s stated aim is a useful intuition for making an optimization decision; the post leaves the choice of measurement approach and any more rigorous validation to the individual benchmark.
Key Questions
What benchmark duration does matklad recommend?
Matklad recommends adjusting the input so a microbenchmark takes about 300 milliseconds. The author describes this as a personal rule of thumb, not a universal requirement.
Why not make a microbenchmark as short as possible?
The post says very short tests, particularly those under about 10ms, can be affected by fixed costs such as interpreter startup. The author argues that a run lasting hundreds of milliseconds can make one-off overhead less prominent.
Why not run the benchmark for several seconds?
Matklad says runs longer than a second make iteration slower than necessary. Keeping individual runs shorter makes it easier to repeat a benchmark, including running it 10 times to inspect variation.
Does 300ms guarantee an accurate performance measurement?
No. The post presents 300ms as a practical heuristic for building intuition and making optimization decisions. It does not provide evidence that this duration guarantees precision across different programs, tools or environments.
Source: hn
Fall Picks
fall essentials
As an affiliate, we earn on qualifying purchases.
