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

Optimize loading time for "welspell_config" #16

Open
GegznaV opened this issue Oct 3, 2019 · 3 comments
Open

Optimize loading time for "welspell_config" #16

GegznaV opened this issue Oct 3, 2019 · 3 comments

Comments

@GegznaV
Copy link
Contributor

GegznaV commented Oct 3, 2019

When I try to open "welspell_config" window, on my PC it takes several seconds to open. Sometimes I start doubting if I even pressed the hot-key combination to open the tool.

I did some quick profiling. One of the bottlenecks on LanguageToolR side is function "lato_list_languages"
image

Next, lato_test_setup() is called several times.
image

Is it possible to optimize these processes?

Some ideas would be:

  • to open window and load contents asynchronously: first, the window could be created and, next, the contents are updated. Some spinner of progress bar could be added to indicate, that the settings are still loading.
  • to open the settings of spelling and grammar tools asynchronously (only when required tab is activated). It would be time saver especially if we need only one tool but not both.
@GegznaV
Copy link
Contributor Author

GegznaV commented Oct 3, 2019

One of the options would be to use stringi::stri_join() instead of paste() as stringi is already used as a dependency.

See awalker89/openxlsx#440 for details.

@nevrome
Copy link
Owner

nevrome commented Oct 6, 2019

What do you think about c3cfb3e? I wanted to do a PR, but my fingers where faster than my brain.

@GegznaV
Copy link
Contributor Author

GegznaV commented Oct 7, 2019

The result of Sys.setenv() is saved only for the current R session. For the repeated configuration in the same session, it helps, but for the first time configuration, it doesn't.

Note. If a method, which permanently saves the environment variable, is implemented, there should be a way to update the list of the languages if it changes. E.g., on the installation of the language tool. A new button could also be created for this purpose.

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

No branches or pull requests

2 participants