Skip to content

Extremely slow with 700KB file #258

@drjasonharrison

Description

@drjasonharrison

``It took me a while to figure out the cause of my pre-commit hooks getting "stuck" on the doctoc (v2.2.0) step but finally realized that doctoc appeared to be processing a 7000KB .md file that wasn't staged for the git commit. The file contained only three heading entries but the last 99% of the file was log lines from a multi hour run of a program.

Unfortunately, doctoc is still taking more than 25 minutes to process four .md files, because one was more than 700KB. Memory usage was also high at 750MB.

The command according to ps:

/home/jason/.cache/pre-commit/repold2ulagt/node_env-16.14.2/bin/node /home/jason/.cache/pre-commit/repold2ulagt/node_env-16.14.2/bin/doctoc file1.md file2.md file3.md file4.md

After deleting a bunch of lines in that file, it's now only 6000 lines (from 5x lines) and now 188KB. And doctoc updates the TOC with a few seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions