Skip to content

Default file DBs to WAL + synchronous=NORMAL (3x to 18x autocommit writes) #13

Closed

Description

@michaeloboyle

Measurement

2000 createNode calls on a file DB, autocommit:

Mode createNode/s createEdge x2000
default (journal=delete, synchronous=FULL) 1,225 1723ms
WAL + synchronous=NORMAL 26,667 132ms

Inside a transaction both modes are fast (83k to 167k/s), so this matters most for callers who do not batch.

Caveat: measured on an external drive; fsync cost depends on the drive.

Proposal

Default file-backed databases to journal_mode=WAL and synchronous=NORMAL, with an option to opt out ({ wal: false }). No effect on :memory: or readonly DBs.

Benchmark report: 2026-11-02, Apple M2 Pro, Node 22, at a7f9ea7.

Activity

  1. michaeloboyle commented on Nov 2, 2026

    @michaeloboyle
    OwnerAuthor

    Re-measured, 5 alternating runs of 2000 autocommit createNode each, medians: internal SSD 1,491/s without WAL vs 4,405/s with WAL (~3x, ranges do not overlap); external drive 1,202/s vs 21,277/s (~18x). The ~22x in the description is the external-drive case; expect ~3x on a fast internal SSD.

  2. changed the title [-]Default file DBs to WAL + synchronous=NORMAL (~22x autocommit writes)[/-] [+]Default file DBs to WAL + synchronous=NORMAL (3x to 18x autocommit writes)[/+] on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions