# fs: Reduce IterableDir.Iterator \`buf\` size to 1024 · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/39f192d54eba99ba3dfc7066476912633e694d51)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 39f192d54eba99ba3dfc7066476912633e694d51

Requested commit: 39f192d54eba99ba3dfc7066476912633e694d51

Commit: 39f192d54eba99ba3dfc7066476912633e694d51

Tree: ca8f102cbcac4bd7c9a21207f0eae8db3135e9bb

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
fs: Reduce IterableDir.Iterator `buf` size to 1024

This was sized large so that `getdents` (and other platforms' equivalents) could provide large amounts of entries per syscall, but some benchmarking seems to indicate that the larger 8192 sizing doesn't actually lead to performance gains outside of edge cases like extremely large amounts of entries within a single directory (e.g. 25,000 files in one directory), and even then the gains are minimal ('./walk-8192 dir-with-tons-of-entries' ran 1.02 ± 0.34 times faster than './walk-1024 dir-with-tons-of-entries').

Note: Sizes 1024 and 2048 had similar performance characteristics, so the smaller of the two was chosen.

```

## Parents

- [274d19575ea1ebaea593cdca7c5afa8303153cb4](https://git.cafe/gitcafe/zig/commit/274d19575ea1ebaea593cdca7c5afa8303153cb4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/39f192d54eba99ba3dfc7066476912633e694d51?format=markdown)
