I recently decided to try to update the version of LangauageTool I was using from 4.5 to 5.5. 5.5 seems to be almost 20 times slower than 4.5 when being used for automated requests.
Is there something that I am missing?
The python code that I was using to verify this is below
from pylanguagetool import api
import time
import os
import sys
start = time.perf_counter()
for i in range(0, 100):
api.check("Test Text", "http://127.0.0.1:8081/v2/", lang='en-US')
print(f'LanguageTool took {time.perf_counter() - start}')
After migration of LanguageTool version from 4.x to 5.7 i noticed that it’s http server now works much much slower, as already described by @tsonnen. I’ve found this thread and tried to apply a config as advised here
but i got no effect on speed, despite @tsonnen who started this thread confirmed it helped, so i wonder why that can be like that in my case? Can that be windows-specific (as i am on Windows) or maybe the command-line and/or contents of languagetool.cfg file is somehow incorrect? Or java version?
Also, which changes between versions could reduce the speed that much at all? Was that different default values for those 3 mentioned config options, so now it’s required to set them up explicitly to get the speed back? And/or was there much more rules added in newer version so that much more time is now required to test given text against those rules? Also, is it possible to add an option to turn off replacement suggestions calculation as in my case it doesn’t need that while batch processing, and if yes, would that increase the speed?
Could you share a curl call that’s slow and let us know how long it takes? Is it still slow the second the time the same curl is called? In general, LT is slow for the first start-up and then fast after the first few requests for a language. Speed then depends on text length and language used (some languages are slower than other because they have more rules).