platers / obsidian-linter

An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
https://platers.github.io/obsidian-linter/
MIT License
1.24k stars 82 forks source link

Bug: Linter freezes Obsidian V1.4.5 on Fedora Silverblue 38 Flatpak #872

Open dougkeiller opened 1 year ago

dougkeiller commented 1 year ago

Describe the Bug

When Linter "lints" a file, Obsidian freezes. Only way to unfreeze is to restart.

Disabling Linter prevents this from happening, so definitely narrowed to Linter as cause of freeze.

Rules

If you are not sure which rule(s) may cause the issue, please attach the data.json file located at <vault>/.obsidian/plugins/obsidian-linter/ or copy the config from the debug tab.

{
  "ruleConfigs": {
    "escape-yaml-special-characters": {
      "enabled": false,
      "try-to-escape-single-line-arrays": false
    },
    "force-yaml-escape": {
      "enabled": false,
      "force-yaml-escape-keys": ""
    },
    "format-tags-in-yaml": {
      "enabled": false
    },
    "format-yaml-array": {
      "enabled": false,
      "alias-key": true,
      "tag-key": true,
      "default-array-style": "single-line",
      "default-array-keys": true,
      "force-single-line-array-style": "",
      "force-multi-line-array-style": ""
    },
    "insert-yaml-attributes": {
      "enabled": false,
      "text-to-insert": "aliases: \ntags: "
    },
    "move-tags-to-yaml": {
      "enabled": false,
      "how-to-handle-existing-tags": "Nothing",
      "tags-to-ignore": ""
    },
    "remove-yaml-keys": {
      "enabled": false,
      "yaml-keys-to-remove": ""
    },
    "yaml-key-sort": {
      "enabled": false,
      "yaml-key-priority-sort-order": "",
      "priority-keys-at-start-of-yaml": true,
      "yaml-sort-order-for-other-keys": "None"
    },
    "yaml-timestamp": {
      "enabled": false,
      "date-created": true,
      "date-created-key": "date created",
      "force-retention-of-create-value": false,
      "date-modified": true,
      "date-modified-key": "date modified",
      "format": "dddd, MMMM Do YYYY, h:mm:ss a"
    },
    "yaml-title": {
      "enabled": false,
      "title-key": "title",
      "mode": "first-h1-or-filename-if-h1-missing"
    },
    "yaml-title-alias": {
      "enabled": false,
      "preserve-existing-alias-section-style": true,
      "keep-alias-that-matches-the-filename": false,
      "use-yaml-key-to-keep-track-of-old-filename-or-heading": true
    },
    "capitalize-headings": {
      "enabled": true,
      "style": "Title Case",
      "ignore-case-words": true,
      "ignore-words": "macOS, iOS, iPhone, iPad, JavaScript, TypeScript, AppleScript, I",
      "lowercase-words": "a, an, the, aboard, about, abt., above, abreast, absent, across, after, against, along, aloft, alongside, amid, amidst, mid, midst, among, amongst, anti, apropos, around, round, as, aslant, astride, at, atop, ontop, bar, barring, before, B4, behind, below, beneath, neath, beside, besides, between, 'tween, beyond, but, by, chez, circa, c., ca., come, concerning, contra, counting, cum, despite, spite, down, during, effective, ere, except, excepting, excluding, failing, following, for, from, in, including, inside, into, less, like, minus, modulo, mod, near, nearer, nearest, next, notwithstanding, of, o', off, offshore, on, onto, opposite, out, outside, over, o'er, pace, past, pending, per, plus, post, pre, pro, qua, re, regarding, respecting, sans, save, saving, short, since, sub, than, through, thru, throughout, thruout, till, times, to, t', touching, toward, towards, under, underneath, unlike, until, unto, up, upon, versus, vs., v., via, vice, vis-à-vis, wanting, with, w/, w., c̄, within, w/i, without, 'thout, w/o, abroad, adrift, aft, afterward, afterwards, ahead, apart, ashore, aside, away, back, backward, backwards, beforehand, downhill, downstage, downstairs, downstream, downward, downwards, downwind, east, eastward, eastwards, forth, forward, forwards, heavenward, heavenwards, hence, henceforth, here, hereby, herein, hereof, hereto, herewith, home, homeward, homewards, indoors, inward, inwards, leftward, leftwards, north, northeast, northward, northwards, northwest, now, onward, onwards, outdoors, outward, outwards, overboard, overhead, overland, overseas, rightward, rightwards, seaward, seawards, skywards, skyward, south, southeast, southwards, southward, southwest, then, thence, thenceforth, there, thereby, therein, thereof, thereto, therewith, together, underfoot, underground, uphill, upstage, upstairs, upstream, upward, upwards, upwind, west, westward, westwards, when, whence, where, whereby, wherein, whereto, wherewith, although, because, considering, given, granted, if, lest, once, provided, providing, seeing, so, supposing, though, unless, whenever, whereas, wherever, while, whilst, ago, according to, as regards, counter to, instead of, owing to, pertaining to, at the behest of, at the expense of, at the hands of, at risk of, at the risk of, at variance with, by dint of, by means of, by virtue of, by way of, for the sake of, for sake of, for lack of, for want of, from want of, in accordance with, in addition to, in case of, in charge of, in compliance with, in conformity with, in contact with, in exchange for, in favor of, in front of, in lieu of, in light of, in the light of, in line with, in place of, in point of, in quest of, in relation to, in regard to, with regard to, in respect to, with respect to, in return for, in search of, in step with, in touch with, in terms of, in the name of, in view of, on account of, on behalf of, on grounds of, on the grounds of, on the part of, on top of, with a view to, with the exception of, à la, a la, as soon as, as well as, close to, due to, far from, in case, other than, prior to, pursuant to, regardless of, subsequent to, as long as, as much as, as far as, by the time, in as much as, inasmuch, in order to, in order that, even, provide that, if only, whether, whose, whoever, why, how, or not, whatever, what, both, and, or, not only, but also, either, neither, nor, just, rather, no sooner, such, that, yet, is, it"
    },
    "file-name-heading": {
      "enabled": true
    },
    "header-increment": {
      "enabled": true,
      "start-at-h2": false
    },
    "headings-start-line": {
      "enabled": true
    },
    "remove-trailing-punctuation-in-heading": {
      "enabled": false,
      "punctuation-to-remove": ".,;:!。,;:!"
    },
    "footnote-after-punctuation": {
      "enabled": false
    },
    "move-footnotes-to-the-bottom": {
      "enabled": false
    },
    "re-index-footnotes": {
      "enabled": false
    },
    "auto-correct-common-misspellings": {
      "enabled": true,
      "ignore-words": ""
    },
    "blockquote-style": {
      "enabled": true,
      "style": "space"
    },
    "convert-bullet-list-markers": {
      "enabled": true
    },
    "emphasis-style": {
      "enabled": true,
      "style": "consistent"
    },
    "no-bare-urls": {
      "enabled": true
    },
    "ordered-list-style": {
      "enabled": true,
      "number-style": "ascending",
      "list-end-style": "."
    },
    "proper-ellipsis": {
      "enabled": true
    },
    "quote-style": {
      "enabled": true,
      "single-quote-enabled": true,
      "single-quote-style": "''",
      "double-quote-enabled": true,
      "double-quote-style": "\"\""
    },
    "remove-consecutive-list-markers": {
      "enabled": true
    },
    "remove-empty-list-markers": {
      "enabled": true
    },
    "remove-hyphenated-line-breaks": {
      "enabled": true
    },
    "remove-multiple-spaces": {
      "enabled": true
    },
    "strong-style": {
      "enabled": true,
      "style": "consistent"
    },
    "two-spaces-between-lines-with-content": {
      "enabled": true
    },
    "unordered-list-style": {
      "enabled": true,
      "list-style": "consistent"
    },
    "compact-yaml": {
      "enabled": true,
      "inner-new-lines": false
    },
    "consecutive-blank-lines": {
      "enabled": true
    },
    "convert-spaces-to-tabs": {
      "enabled": true,
      "tabsize": "1"
    },
    "empty-line-around-blockquotes": {
      "enabled": false
    },
    "empty-line-around-code-fences": {
      "enabled": false
    },
    "empty-line-around-math-blocks": {
      "enabled": false
    },
    "empty-line-around-tables": {
      "enabled": false
    },
    "heading-blank-lines": {
      "enabled": true,
      "bottom": true,
      "empty-line-after-yaml": true
    },
    "line-break-at-document-end": {
      "enabled": false
    },
    "move-math-block-indicators-to-their-own-line": {
      "enabled": false
    },
    "paragraph-blank-lines": {
      "enabled": true
    },
    "remove-empty-lines-between-list-markers-and-checklists": {
      "enabled": false
    },
    "remove-link-spacing": {
      "enabled": true
    },
    "remove-space-around-characters": {
      "enabled": true,
      "include-fullwidth-forms": true,
      "include-cjk-symbols-and-punctuation": true,
      "include-dashes": true,
      "other-symbols": ""
    },
    "remove-space-before-or-after-characters": {
      "enabled": true,
      "characters-to-remove-space-before": ",!?;:).’”]",
      "characters-to-remove-space-after": "¿¡‘“(["
    },
    "space-after-list-markers": {
      "enabled": true
    },
    "space-between-chinese-japanese-or-korean-and-english-or-numbers": {
      "enabled": false
    },
    "trailing-spaces": {
      "enabled": true,
      "twp-space-line-break": true
    },
    "add-blockquote-indentation-on-paste": {
      "enabled": false
    },
    "prevent-double-checklist-indicator-on-paste": {
      "enabled": true
    },
    "prevent-double-list-item-indicator-on-paste": {
      "enabled": true
    },
    "proper-ellipsis-on-paste": {
      "enabled": true
    },
    "remove-hyphens-on-paste": {
      "enabled": true
    },
    "remove-leading-or-trailing-whitespace-on-paste": {
      "enabled": true
    },
    "remove-leftover-footnotes-from-quote-on-paste": {
      "enabled": true
    },
    "remove-multiple-blank-lines-on-paste": {
      "enabled": true
    }
  },
  "lintOnSave": true,
  "recordLintOnSaveLogs": true,
  "displayChanged": true,
  "lintOnFileChange": true,
  "displayLintOnFileChangeNotice": true,
  "settingsConvertedToConfigKeyValues": true,
  "foldersToIgnore": [],
  "linterLocale": "system-default",
  "logLevel": 1,
  "lintCommands": [],
  "customRegexes": [],
  "commonStyles": {
    "aliasArrayStyle": "single-line",
    "tagArrayStyle": "single-line",
    "minimumNumberOfDollarSignsToBeAMathBlock": 2,
    "escapeCharacter": "\"",
    "removeUnnecessaryEscapeCharsForMultiLineArrays": false
  }
}

Expected Behavior

Expected Obsidian to not freeze.

Screenshots

If applicable, add screenshots to help explain your problem.

Attached

(Freezes at end of the video...not sure why took so long...usually freezes almost immediately)

Screencast from 2023-09-01 15-43-06.webm

Device

Additional Context

Add any other context about the problem here.

pjkaufman commented 1 year ago

Hey @dougkeiller , could you provide a file that causes this issue? I am not sure if I can reproduce the issue with just the config.

pjkaufman commented 1 year ago

It looks like based on the video that it is hanging trying to lint a specific file. So it is likely not version specific, but I will need whatever file is causing the issue in order to be able to debug the issue since I am not currently able to reproduce this issue in my test vault.

dougkeiller commented 1 year ago

The Princeton Guide to Evolution.md

I know this is a big file....the linting process is what freezes Obsidian

pjkaufman commented 1 year ago

Thanks for providing the file. My best guess as to what the problem is is that something is running into an infinite loop. Either that or the file is so large it is causing issues with one of the parsers. The latter is something I have little control over. But I will update the issue with info about the issue when I confirm it.

pjkaufman commented 1 year ago

@dougkeiller , I think I see what is going on, but I am not sure I can do a whole lot to prevent Obsidian from freezing up when trying to lint a file of this size. According to the debug logs the following seems to be the duration of the file being linted:

...
[Obsidian Linter] parsing text: 10900.09999999404 ms
....
[Obsidian Linter] rules running: 506026.200000003 ms

That comes out to about 506 seconds or about 9 minutes.

I also wanted to know how long it took to parse the file without anything else being done. Each time the Linter parsed the text it took about 10 seconds. The Linter has to parse the file each time it tries to ignore something or run a rule that relies on the structure of the file. This happens quite a bit on a file. This adds up. In this case, that is where the Linter is spending most of its time in each rule. Most rules took 10 seconds or more to run with the parsing of the file text causing the slowdown. Unfortunately I cannot really speed up the parser itself, so something else would have to change to help keep Obsidian from seeming to freeze.

I can show a warning on files larger than a certain size that asks if you want to lint the file knowing it could take more than 5 minutes to run and Obsidian will freeze up in the meantime. How does that sound? Can you think of any other alternatives?

pjkaufman commented 1 year ago

Here is the full set of logs minus the text after each rule ran:

[Obsidian Linter] Running File Name Heading
[Obsidian Linter] hashing text: 26.099999994039536 ms
[Obsidian Linter] parsing text: 9712.29999999702 ms
[Obsidian Linter] hashing text: 15.5 ms
LRU cache hit
[Obsidian Linter] parsing text: 15.799999997019768 ms
[Obsidian Linter] hashing text: 12.100000008940697 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.400000005960464 ms
[Obsidian Linter] file-name-heading: 9828 ms
[Obsidian Linter] Running Header Increment
[Obsidian Linter] hashing text: 12.099999994039536 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.5 ms
[Obsidian Linter] hashing text: 21.700000002980232 ms
LRU cache hit
[Obsidian Linter] parsing text: 22.200000002980232 ms
[Obsidian Linter] hashing text: 11.900000005960464 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.200000002980232 ms
[Obsidian Linter] header-increment: 127 ms
[Obsidian Linter] Running Headings Start Line
[Obsidian Linter] hashing text: 12.299999997019768 ms
[Obsidian Linter] parsing text: 9757.09999999404 ms
[Obsidian Linter] hashing text: 13.100000008940697 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.5 ms
[Obsidian Linter] headings-start-line: 9820.70000000298 ms
[Obsidian Linter] Running Auto-correct Common Misspellings
[Obsidian Linter] hashing text: 12 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.200000002980232 ms
[Obsidian Linter] hashing text: 12.100000008940697 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.400000005960464 ms
[Obsidian Linter] hashing text: 12 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.200000002980232 ms
[Obsidian Linter] hashing text: 12 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.100000008940697 ms
[Obsidian Linter] hashing text: 17.400000005960464 ms
[Obsidian Linter] parsing text: 9739.59999999404 ms
[Obsidian Linter] hashing text: 12 ms
[Obsidian Linter] parsing text: 9649.800000011921 ms
[Obsidian Linter] auto-correct-common-misspellings: 20265 ms
[Obsidian Linter] Running Convert Bullet List Markers
[Obsidian Linter] hashing text: 22.099999994039536 ms
[Obsidian Linter] parsing text: 9841.39999999106 ms
[Obsidian Linter] hashing text: 15.599999994039536 ms
LRU cache hit
[Obsidian Linter] parsing text: 16 ms
[Obsidian Linter] hashing text: 13.899999991059303 ms
LRU cache hit
[Obsidian Linter] parsing text: 14.199999988079071 ms
[Obsidian Linter] convert-bullet-list-markers: 9982.09999999404 ms
[Obsidian Linter] Running Emphasis Style
[Obsidian Linter] hashing text: 13.399999991059303 ms
[Obsidian Linter] parsing text: 10423.89999999106 ms
[Obsidian Linter] hashing text: 13.599999994039536 ms
LRU cache hit
[Obsidian Linter] parsing text: 14 ms
[Obsidian Linter] hashing text: 13 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.400000005960464 ms
[Obsidian Linter] hashing text: 12.400000005960464 ms
[Obsidian Linter] parsing text: 9901.5 ms
[Obsidian Linter] hashing text: 12 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.299999997019768 ms
[Obsidian Linter] hashing text: 19.799999997019768 ms
[Obsidian Linter] parsing text: 9994.20000000298 ms
[Obsidian Linter] emphasis-style: 30526.29999999702 ms
[Obsidian Linter] Running No Bare URLs
[Obsidian Linter] hashing text: 12.400000005960464 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.799999997019768 ms
[Obsidian Linter] hashing text: 12.399999991059303 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.699999988079071 ms
[Obsidian Linter] hashing text: 16 ms
LRU cache hit
[Obsidian Linter] parsing text: 16.5 ms
[Obsidian Linter] hashing text: 11.899999991059303 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.099999994039536 ms
[Obsidian Linter] hashing text: 11.799999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.099999994039536 ms
[Obsidian Linter] hashing text: 12 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.200000002980232 ms
[Obsidian Linter] no-bare-urls: 341.59999999403954 ms
[Obsidian Linter] Running Ordered List Style
[Obsidian Linter] hashing text: 12 ms
[Obsidian Linter] parsing text: 10232.40000000596 ms
[Obsidian Linter] hashing text: 12.299999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.599999994039536 ms
[Obsidian Linter] hashing text: 11.900000005960464 ms
[Obsidian Linter] parsing text: 10253.79999999702 ms
[Obsidian Linter] ordered-list-style: 23371.29999999702 ms
[Obsidian Linter] Running Proper Ellipsis
[Obsidian Linter] hashing text: 13.5 ms
[Obsidian Linter] parsing text: 10054.20000000298 ms
[Obsidian Linter] hashing text: 14.900000005960464 ms
LRU cache hit
[Obsidian Linter] parsing text: 15.200000002980232 ms
[Obsidian Linter] hashing text: 12.5 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.799999997019768 ms
[Obsidian Linter] hashing text: 12.100000008940697 ms
[Obsidian Linter] parsing text: 10067.20000000298 ms
[Obsidian Linter] proper-ellipsis: 20269.90000000596 ms
[Obsidian Linter] Running Quote Style
[Obsidian Linter] hashing text: 17.80000001192093 ms
[Obsidian Linter] parsing text: 10067 ms
[Obsidian Linter] hashing text: 12.399999991059303 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.599999994039536 ms
[Obsidian Linter] hashing text: 12.200000002980232 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.400000005960464 ms
[Obsidian Linter] hashing text: 12.5 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.799999997019768 ms
[Obsidian Linter] hashing text: 12.299999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.600000008940697 ms
[Obsidian Linter] hashing text: 17.799999997019768 ms
[Obsidian Linter] parsing text: 10225 ms
[Obsidian Linter] quote-style: 20509.40000000596 ms
[Obsidian Linter] Running Remove Consecutive List Markers
[Obsidian Linter] hashing text: 13.299999997019768 ms
[Obsidian Linter] parsing text: 10425.699999988079 ms
[Obsidian Linter] hashing text: 13.799999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 14.399999991059303 ms
[Obsidian Linter] hashing text: 19.100000008940697 ms
LRU cache hit
[Obsidian Linter] parsing text: 19.400000005960464 ms
[Obsidian Linter] remove-consecutive-list-markers: 10554.29999999702 ms
[Obsidian Linter] Running Remove Empty List Markers
[Obsidian Linter] hashing text: 12.899999991059303 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.199999988079071 ms
[Obsidian Linter] hashing text: 13.799999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 14.100000008940697 ms
[Obsidian Linter] hashing text: 12.5 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.799999997019768 ms
[Obsidian Linter] remove-empty-list-markers: 132.40000000596046 ms
[Obsidian Linter] Running Remove Hyphenated Line Breaks
[Obsidian Linter] hashing text: 14 ms
[Obsidian Linter] parsing text: 10085.29999999702 ms
[Obsidian Linter] hashing text: 12.400000005960464 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.700000002980232 ms
[Obsidian Linter] hashing text: 15 ms
LRU cache hit
[Obsidian Linter] parsing text: 15.299999997019768 ms
[Obsidian Linter] remove-hyphenated-line-breaks: 10197.20000000298 ms
[Obsidian Linter] Running Remove Multiple Spaces
[Obsidian Linter] hashing text: 12.599999994039536 ms
[Obsidian Linter] parsing text: 10203.29999999702 ms
[Obsidian Linter] hashing text: 13.300000011920929 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.5 ms
[Obsidian Linter] hashing text: 11.799999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.200000002980232 ms
[Obsidian Linter] hashing text: 12.200000002980232 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.5 ms
[Obsidian Linter] hashing text: 13.399999991059303 ms
[Obsidian Linter] parsing text: 9735.199999988079 ms
[Obsidian Linter] remove-multiple-spaces: 20142.70000000298 ms
[Obsidian Linter] Running Strong Style
[Obsidian Linter] hashing text: 12.299999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.599999994039536 ms
[Obsidian Linter] hashing text: 12.700000002980232 ms
LRU cache hit
[Obsidian Linter] parsing text: 13 ms
[Obsidian Linter] hashing text: 12.5 ms
[Obsidian Linter] parsing text: 9896.20000000298 ms
[Obsidian Linter] hashing text: 12.299999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.700000002980232 ms
[Obsidian Linter] hashing text: 19 ms
[Obsidian Linter] parsing text: 12599.29999999702 ms
[Obsidian Linter] strong-style: 22687.90000000596 ms
[Obsidian Linter] Running Two Spaces Between Lines with Content
[Obsidian Linter] hashing text: 12.799999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.199999988079071 ms
[Obsidian Linter] two-spaces-between-lines-with-content: 22737.90000000596 ms
[Obsidian Linter] Running Unordered List Style
[Obsidian Linter] hashing text: 12.5 ms
[Obsidian Linter] parsing text: 10520.5 ms
[Obsidian Linter] hashing text: 12.600000008940697 ms
LRU cache hit
[Obsidian Linter] parsing text: 13 ms
[Obsidian Linter] hashing text: 12.299999997019768 ms
[Obsidian Linter] parsing text: 9834.70000000298 ms
[Obsidian Linter] unordered-list-style: 20794.39999999106 ms
[Obsidian Linter] Running Compact YAML
[Obsidian Linter] compact-yaml: 7.100000008940697 ms
[Obsidian Linter] Running Consecutive blank lines
[Obsidian Linter] hashing text: 12.699999988079071 ms
[Obsidian Linter] parsing text: 10642.09999999404 ms
[Obsidian Linter] hashing text: 12.799999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 13 ms
[Obsidian Linter] hashing text: 12.400000005960464 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.600000008940697 ms
[Obsidian Linter] consecutive-blank-lines: 10987.20000000298 ms
[Obsidian Linter] Running Convert Spaces to Tabs
[Obsidian Linter] hashing text: 18.5 ms
LRU cache hit
[Obsidian Linter] parsing text: 19 ms
[Obsidian Linter] hashing text: 15.099999994039536 ms
LRU cache hit
[Obsidian Linter] parsing text: 15.399999991059303 ms
[Obsidian Linter] hashing text: 13.100000008940697 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.5 ms
[Obsidian Linter] convert-spaces-to-tabs: 380.79999999701977 ms
[Obsidian Linter] Running Heading blank lines
[Obsidian Linter] hashing text: 14.299999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 14.700000002980232 ms
[Obsidian Linter] hashing text: 16.099999994039536 ms
LRU cache hit
[Obsidian Linter] parsing text: 16.599999994039536 ms
[Obsidian Linter] hashing text: 12.700000002980232 ms
LRU cache hit
[Obsidian Linter] parsing text: 13 ms
[Obsidian Linter] heading-blank-lines: 362.5 ms
[Obsidian Linter] Running Paragraph blank lines
[Obsidian Linter] hashing text: 15.200000002980232 ms
[Obsidian Linter] parsing text: 10979.70000000298 ms
[Obsidian Linter] paragraph-blank-lines: 49479.60000000894 ms
[Obsidian Linter] Running Remove link spacing
[Obsidian Linter] hashing text: 13.099999994039536 ms
[Obsidian Linter] parsing text: 9888 ms
[Obsidian Linter] remove-link-spacing: 9993.90000000596 ms
[Obsidian Linter] Running Remove Space around Characters
[Obsidian Linter] hashing text: 15 ms
LRU cache hit
[Obsidian Linter] parsing text: 15.400000005960464 ms
[Obsidian Linter] hashing text: 12.899999991059303 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.299999997019768 ms
[Obsidian Linter] hashing text: 12.599999994039536 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.899999991059303 ms
[Obsidian Linter] hashing text: 12.900000005960464 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.200000002980232 ms
[Obsidian Linter] hashing text: 12.5 ms
[Obsidian Linter] parsing text: 9981.79999999702 ms
[Obsidian Linter] hashing text: 16.200000002980232 ms
[Obsidian Linter] parsing text: 12468.70000000298 ms
[Obsidian Linter] remove-space-around-characters: 51719.70000000298 ms
[Obsidian Linter] Running Remove Space Before or After Characters
[Obsidian Linter] hashing text: 12.900000005960464 ms
[Obsidian Linter] parsing text: 10143.60000000894 ms
[Obsidian Linter] hashing text: 12.300000011920929 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.700000002980232 ms
[Obsidian Linter] hashing text: 12.5 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.800000011920929 ms
[Obsidian Linter] hashing text: 12.299999997019768 ms
[Obsidian Linter] parsing text: 9840.09999999404 ms
[Obsidian Linter] hashing text: 54 ms
[Obsidian Linter] parsing text: 9919 ms
[Obsidian Linter] hashing text: 17.599999994039536 ms
[Obsidian Linter] parsing text: 10358.70000000298 ms
[Obsidian Linter] remove-space-before-or-after-characters: 104256.10000000894 ms
[Obsidian Linter] Running Space after list markers
[Obsidian Linter] hashing text: 28.600000008940697 ms
[Obsidian Linter] parsing text: 10044.5 ms
[Obsidian Linter] hashing text: 12.599999994039536 ms
LRU cache hit
[Obsidian Linter] parsing text: 13 ms
[Obsidian Linter] hashing text: 12.299999997019768 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.599999994039536 ms
[Obsidian Linter] space-after-list-markers: 10407.699999988079 ms
[Obsidian Linter] Running Trailing spaces
[Obsidian Linter] hashing text: 18.200000002980232 ms
LRU cache hit
[Obsidian Linter] parsing text: 18.5 ms
[Obsidian Linter] hashing text: 14.100000008940697 ms
LRU cache hit
[Obsidian Linter] parsing text: 14.400000005960464 ms
[Obsidian Linter] hashing text: 12.899999991059303 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.200000002980232 ms
[Obsidian Linter] trailing-spaces: 374.6000000089407 ms
[Obsidian Linter] Running Custom Regex
[Obsidian Linter] custom regex rules: 7 ms
[Obsidian Linter] Running Capitalize Headings
[Obsidian Linter] hashing text: 13.400000005960464 ms
LRU cache hit
[Obsidian Linter] parsing text: 13.700000002980232 ms
[Obsidian Linter] hashing text: 12.400000005960464 ms
LRU cache hit
[Obsidian Linter] parsing text: 12.599999994039536 ms
[Obsidian Linter] capitalize-headings: 236.3999999910593 ms
[Obsidian Linter] Running Blockquote Style
[Obsidian Linter] hashing text: 18.700000002980232 ms
LRU cache hit
[Obsidian Linter] parsing text: 19.100000008940697 ms
[Obsidian Linter] hashing text: 17.299999997019768 ms
[Obsidian Linter] parsing text: 10900.09999999404 ms
[Obsidian Linter] blockquote-style: 11210.60000000894 ms
[Obsidian Linter] rules after regular rules: 11734.89999999106 ms
[Obsidian Linter] rules running: 506026.200000003 ms
[Obsidian Linter] Running Custom Lint Commands

Some rules could definitely benefit from performance boosts, but many of them are being constrained by the parser.

Note to self, here are some rules that could take being looked at since they seem to be unperformant:

dougkeiller commented 1 year ago

@pjkaufman

Many many thanks for your fast, thoughtful responses here!

Obsidian just updated this package, and I successfully linted a smaller file without changing the setting :-) Although, I really appreciate you identifying which settings are bogging things down.

I'll let you know if I run into trouble again in this thread (assuming same behavior).

BTW, while Linter was slow, I looked for workarounds for my workflow, quite unsuccessfully, including a VSCode Linter that doesn't autocorrect (only provides errors) unlike the Obsidian Linter, which has awesome autocorrect on save/change. You guys have built a great plugin, super high value.

A random idea is to add more specific use case packages like the VSCode Linter. The two I am most interested in are LanguageTool and proselint for my writing (I'm not coding).

Didn't get them working yet, so not sure if they add something more than Vale, which is pretty amazing, but just to share a thought for the roadmap.

LMK how I can support you guys in your efforts. Bravo!

pjkaufman commented 1 year ago

I believe that LanguageTool has its own plugin and proselint looks to be a python application. It would likely need to be its own plugin and be desktop only given the constraints. But those are interesting ideas.

My speciality is more backend in terms of changes as opposed to things that show in the UI for users which has been a decent hold up for adding certain things. But it may be feasible to get something in place at some point for some of these things.

pjkaufman commented 1 year ago

This would be partially fixed by #337 since the Linter would not run on the main thread. It would allow for the file to get linted without freezing the screen. I will need to work on that at some point.