Skip to content

Startup I/O: LogFileSink scans the log directory ~5x at boot; per-line sync appends #584

Description

@LeeKuang666

main.js:2470-2475 constructs LogFileSink then calls enforceDirectoryCap() and purgeOlderThan(7); each internally re-walks ownedFiles() and re-measures directoryBytes (log-files-Bfo6ODqx.js:69,:90-96,:112). Additionally every log line opens/writes/closes the file (:106 comment "files are closed after every append").

Suggestion: take one ownedFiles() snapshot shared by constructor/cap/purge; move trimming off the critical path; keep a persistent append handle.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions