You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[...]
Compiling harper-cli v0.1.0 (/home/runner/work/harper/harper/harper-cli)
Compiling harper-ls v0.71.0 (/home/runner/work/harper/harper/harper-ls)
Compiling harper-wasm v0.1.0 (/home/runner/work/harper/harper/harper-wasm)
Finished `release` profile [optimized + debuginfo] target(s) in 2m 10s
heaptrack stats:
allocations: 2535728
leaked allocations: 43210
temporary allocations: 894059
Peak heap usage: 130.37M
/home/runner/.config/harper-ls/dictionary.txt: No such file or directory (os error 2)
/home/runner/.local/share/harper-ls/file_dictionaries/test.txt%: No such file or directory (os error 2)
Warning: could not detect language ID; falling back to PlainEnglish parser.
Advice:
╭─[test.txt:1:1]
│
1 │ Ths is a test.
│ ─┬─
│ ╰─── Did you mean to spell `Ths` this way?
───╯
real 0m0.545s
user 0m0.493s
sys 0m0.053s
And this is after erasing all words from the English dictionary (except for "this", "is", "a", "test"):
[...]
Compiling harper-wasm v0.1.0 (/home/runner/work/harper/harper/harper-wasm)
Compiling harper-cli v0.1.0 (/home/runner/work/harper/harper/harper-cli)
Compiling harper-ls v0.71.0 (/home/runner/work/harper/harper/harper-ls)
Finished `release` profile [optimized + debuginfo] target(s) in 2m 10s
heaptrack stats:
allocations: 1422507
leaked allocations: 38950
temporary allocations: 351464
Peak heap usage: 7.89M
/home/runner/.config/harper-ls/dictionary.txt: No such file or directory (os error 2)
/home/runner/.local/share/harper-ls/file_dictionaries/test.txt%: No such file or directory (os error 2)
Warning: could not detect language ID; falling back to PlainEnglish parser.
Advice:
╭─[test.txt:1:1]
│
1 │ Ths is a test.
│ ─┬─
│ ╰─── Did you mean to spell `Ths` this way?
───╯
real 0m0.143s
user 0m0.133s
sys 0m0.011s
It looks like the lion's share of the memory footprint is contributed by the dictionary. It's reported as ~130MB for harper-cli (and ~170MB for the Firefox plugin) with a full dictionary, and merely ~8MB when the dictionary is stripped. Additionally, roughly ~400 milliseconds are added to the Harper's startup time on a rather powerful github CI machine to initialize the dictionary.
These numbers look very suspicious to me. Because the FST data structure used for the dictionary is supposed to be much more compact: #138
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! As an attempt to investigate why the plugin for Firefox has a high memory usage, I made the following git branch for testing purposes: https://github.com/ssvb/harper/commits/heaptrack/ with two commits. One commit introduces the use of the heaptrack tool, which is run in a github CI job on a simple
harper-cli lintinvocation. And another commit just erases almost all words from the English dictionary. Here are the results with the intact English dictionary:And this is after erasing all words from the English dictionary (except for "this", "is", "a", "test"):
It looks like the lion's share of the memory footprint is contributed by the dictionary. It's reported as ~130MB for
harper-cli(and ~170MB for the Firefox plugin) with a full dictionary, and merely ~8MB when the dictionary is stripped. Additionally, roughly ~400 milliseconds are added to the Harper's startup time on a rather powerful github CI machine to initialize the dictionary.These numbers look very suspicious to me. Because the FST data structure used for the dictionary is supposed to be much more compact: #138
Beta Was this translation helpful? Give feedback.
All reactions