I have a web application in which users submit requests to the Lucene index. Requests are parsed by Lucene
QueryParser. I have learned that QueryParserit is not thread safe.
Is it better to use one instance QueryParserand synchronize it when called with its method parse()? Or is it better to build a new instance for each request? (Or am I better off serving pool QueryParsers?)
I know that in general such questions depend on the details and require profiling, but perhaps one of them can finally say “ QueryParserextremely inexpensive / expensive to build”?
source
share