Repository navigation
2.8.0
SingleBuffer v2 layout
Important
By default, the v2 layout will only apply to new file systems.
Existing v1 layout file systems will not be upgraded automatically.
You can pass v2: true to the backend to upgrade existing v1 layouts.
Passing v2: false (must be literally false) will force the v1 layout.
This release introduces a new disk layout for SingleBuffer, which uses a CoW B+ tree. This has resulted in faster random reads and writes:
| Benchmark | File | Ops | v1 avg/op | v1 MB/s | v2 avg/op | v2 MB/s | Speedup |
|---|---|---|---|---|---|---|---|
| Read | 1 MiB | 256 | 163 µs | 25.2 | 35 µs | 116.9 | 4.6× |
| Read | 8 MiB | 1024 | 1,019 µs | 4.0 | 20 µs | 206.9 | 51× |
| Read | 32 MiB | 1024 | 10,780 µs | 0.38 | 18 µs | 230.8 | 607× |
| Write, cached + close | 1 MiB | 256 | 13 µs | 311.2 | 17 µs | 247.2 | ~1× |
| Write, cached + close | 8 MiB | 1024 | 1,461 µs | 2.8 | 325 µs | 12.6 | 4.5× |
| Write, O_SYNC | 1 MiB | 256 | 600 µs | 6.8 | 240 µs | 17.1 | 2.5× |
| Write, O_SYNC | 8 MiB | 1024 | 3,471 µs | 1.18 | 666 µs | 6.15 | 5.2× |
Before, allocations would never be freed in order to keep the allocator as simple as possible. The new layout replaces this behavior, which results in much better space utilization:
| Benchmark | Buffer | v1 result | v2 result |
|---|---|---|---|
| Write then delete one 4 KiB file ×10,000 (#323) | 1 MiB | Failed after 126 ops, 1.05 MB | 26 KB |
| Random 4 KiB O_SYNC writes ×2048, 8 MiB file | 32 MiB | 8.40 MB | 8.42 MB |
| Append 4 KiB ×1024 (to 4 MiB) | 32 MiB | Failed after 127 ops, 33.8 MB | 5.41 MB |
| 2000 files of 1 KiB, one directory | 32 MiB | 31.6 MB | 10.5 MB |
| Mixed creates, overwrites, deletes (0-64 KiB) ×5000 | 16 MiB | Failed after 707 ops, 16.8 MB | 5.29 MB |
Supporting changes:
StoreFS.allocNewnow supports allocations done by the store- Fixed partial stores not being able to differentiate replacements
- Added sbfs v1->v2 upgrade path
- Added version checking to
SingleBuffer - Added sbfs r/w benchmarks
umask
This release also adds support for umask. This applies to contexts and masks bits on created files' permissions mods. See man umask(2) for more information. This was initially drafted in #326.
Misc. / Bug Fixes
- Fixed metadata operations failing on directories and needing permissions (#327)
- Fixed VFS async
openchecking creation mode instead of existing file mode - Fixed
Async()not having async operations wait for the queue