question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pre-parsed dictionaries

See original GitHub issue

Sometimes parsing a dictionary is a major bottleneck as that can take multiple seconds:

image

If it takes that long in the best case scenario the app’s spell checking, or whatever feature built on top of nspell, is going to feel broken, in the worst case scenario (single-core machines or machines where all other cores are busy) the app may become pretty unresponsive and slow for long enough that the user will just kill it.

I think a potential way to address this problem would be pre-parsing dictionaries, essentially skipping building the internal data structures from the raw dictionary file and loading them directly.

Would that be possible? If so could you give me some pointers on how I should go about implementing that? I’m thinking perhaps a serialize and deserialize methods could be implemented for this purpose.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
wooormcommented, Sep 21, 2020

It sounds pretty complicated indeed 😅

I’m closing this because the actual problem should in part be solved by the PR, making this issue less of a thing!

1reaction
fabiospampinatocommented, Sep 21, 2020

@wooorm Yeah I’m already running nspell in a web worker, otherwise everything would just hang. I was actually thinking about using multiple web workers, I’m not sure if this is feasible because I’m not too sure about how the whole thing works, but do you think for example chunking the dictionary in 4 parts, making a nspell instance for each of them, and then managing them all would essentially parallelize the entire thing? Or would that not work for some reason?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best 1 Definitions of Preparsed
Words Near Preparsed in the Dictionary · prepare-the-way · prepares · preparest · prepareth · preparing · preparse · preparsed · preparses ......
Read more >
preparsed
VerbEdit. preparsed. simple past tense and past participle of preparse.
Read more >
preparse: meaning, definition
Entries where "preparse" occurs: prepares: see also préparés, prépares, preparés‎ prepares (English) Verb prepares Third-person singular simple present ...
Read more >
preparsed Definition - English Dictionary | preparsed Explanations ...
The definition of preparsed in Dictionary is as: simple past tense and past ... Grammatically, this word "preparsed" is a verb, more specifically,...
Read more >
Pre-parsed Word Format - colorForth
Pre-parsed words ... The current location in the dictionary is placed in a parallel table of locations. ... The word 'forth' selects the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found