Skip to content

IndexedDB FS implementation#5

Merged
firu11 merged 8 commits into
mainfrom
indexed-db
Apr 29, 2026
Merged

IndexedDB FS implementation#5
firu11 merged 8 commits into
mainfrom
indexed-db

Conversation

@firu11
Copy link
Copy Markdown
Member

@firu11 firu11 commented Apr 24, 2026

In addition to #4, I created a replacement billy.Filesystem implementation using IndexedDB as the underlying storage.

Why?

The Firefox OPFS implementation is extremely slow and nearly unusable on Linux. While it performs well for pure I/O, operations such as creating, moving, and deleting files/blobs are slow enough that Git’s internal operations can make commits take several seconds.

IndexedDB is a key-value database, so emulating a filesystem requires structuring the data across two stores:

  • info - stores metadata about files and directories
    example:
    /CALENDAR_NAME/events/UUID.json -> name="UUID.json" size=116 mod_time=1777064650150 mode=438

  • content - stores file contents (directories are not stored here)
    example:
    /CALENDAR_NAME/events/UUID.json -> binary data

This two-store-layout is inspired by hack-pad/go-indexeddb.


Head-to-head comparison:

Device: Linux+Firefox laptop
Operation: Save Event (includes saving the event itself and git add+commit ops.)

OPFS: ~1.15s
IndexedDB: ~49ms

@firu11 firu11 requested a review from ondrej-salat April 24, 2026 21:30
@firu11 firu11 self-assigned this Apr 24, 2026
@firu11 firu11 added the enhancement New feature or request label Apr 24, 2026
@firu11 firu11 marked this pull request as ready for review April 26, 2026 10:26
@firu11 firu11 changed the base branch from main to fs-refactor April 26, 2026 10:30
Base automatically changed from fs-refactor to main April 29, 2026 21:05
@firu11 firu11 merged commit 21cbcc8 into main Apr 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant