Skip to content

The final fsync makes it 16 times slower #155

Open
@davidfirst

Description

@davidfirst

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I'm writing 6,700 files.
If I pass fsync: false to the options, it takes 9 seconds.
If I don't, it defaults to true, and it takes 152 seconds (!).

From the docs I see this:

If the fsync option is false, writeFile will skip the final fsync call.

Could you explain how important this final fsync call is? I'm considering to disable it.

Expected Behavior

I wish to have it faster, or understand whether it's safe to cancel the fsync.

Steps To Reproduce

try to write lots of files ( > 1000) to see the issue clearly.

Environment

  • npm: 8.1.2
  • Node: v16.13.2
  • OS: Mac OS 12.6
  • platform: Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds an initial review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions