Automattic / Automattic/harper
Performance issues with default of -1 no delay configured
- Dominant language
- Rust
- Stars
- 15.4k
- Forks
- 627
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 106
Description
**Describe the bug**
Currently, when I am editing large files in Obsidian (over 1k lines) the harper web worker thread takes over 30 seconds to process the entire file and produce spell checking results when the default delay is set to none. I initially thought it was an outright performance issue and a lack of proper file chunking, but it turned out to be connected to the delay variable being set to none.
Side note: There is a visual bug with the delay slider in Obsidian, where the value does not show until you restart obsidian, so clicking out of the plugin settings and back in shows the old value.
**To Reproduce**
Steps to reproduce the behavior:
1. Open a markdown file with over 1k lines and a few spell checking errors in Obsidian with this plugin
2. Type for a few seconds
3. Wait and observer task manager or system monitor for a thread spike
4. Watch until the spellcheck errors actually appear, and the thread dies down.
5. Adjust the delay slider to something greater
6. No problems.
Visual bug:
1. Open plugin settings
2. Change the delay slider
3. Click out of the plugin settings
4. Open harper settings again and notice the slider has not gotten the updated value
5. Restart obsidian
6. Go into harper settings again and notice the proper value.
**Expected behavior**
Harper would have a better default to help with large files and not constantly check over.
**Screenshots**
**Platform**
Obsidian 1.12.7
**Additional context**
https://github.com/Automattic/harper/issues/1142 appears related with large file performance.
Contributor guide
Research direction
The issue does not name specific files or tests. Reproduce it in the Obsidian plugin with a markdown file over 1,000 lines, then inspect the delay setting and slider state handling; done means a safer default avoids the processing spike and changing the slider is reflected without restarting Obsidian.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop-dev, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100