Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use async coroutines to speed up ngram probability lookup #84

Closed
pemistahl opened this issue Dec 12, 2020 · 1 comment
Closed

Use async coroutines to speed up ngram probability lookup #84

pemistahl opened this issue Dec 12, 2020 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@pemistahl
Copy link
Owner

pemistahl commented Dec 12, 2020

Currently, loading a LanguageDetector's language models is relatively slow because it is done sequentially. Kotlin's coroutines should be the proper means to speed up this process.

@pemistahl pemistahl added the enhancement New feature or request label Dec 12, 2020
@pemistahl pemistahl added this to the Lingua 1.1.0 milestone Dec 12, 2020
@pemistahl pemistahl changed the title Use parallel streams to speed up ngram probability lookup Use async coroutines to speed up ngram probability lookup Feb 15, 2021
@Marcono1234
Copy link
Contributor

The commit 03c9b62 fixing this might have introduced a thread-safety issue. Reassigning a local variable (here filteredLanguages) concurrently from different threads is not safe, see this StackOverflow answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants