donnerpeter opened a new pull request #24:
URL: https://github.com/apache/lucene/pull/24


   <!--
   _(If you are a project committer then you may remove some/all of the 
following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system 
for Lucene:
   
   * https://issues.apache.org/jira/projects/LUCENE
   
   You will need to create an account in Jira in order to create an issue.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * LUCENE-####: <short description of problem or changes>
   
   LUCENE must be fully capitalized. A short description helps people scanning 
pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly 
updated with code review comments and commits. -->
   
   
   # Description
   
   Make the API thread-safe to simplify clients and prevent mistakes
   
   # Solution
   
   Remove mutable fields from Stemmer
   
   # Tests
   
   `TestPerformance` enriched with multi-threaded stemming measurement, to 
ensure that GC threads (with presumably higher load) won't affect the speed 
significantly. And they appear not to. There some degradations in stemming, but 
they seem humble to me. There also are some in spellchecking, but given the 
thread-safety benefits, I think we can live with those, especially considering 
it's a brand new API.
   
   The times on my corpora:
   
   Activity | Average time after change | Average time before change
   --- | --- | ---
   Stemming de | 666.1428571428571 | 636.2857142857143
   Multi-threaded stemming de | 569.0 | 556.8571428571429
   Spellchecking de | 756.2857142857143 | 714.5714285714286
   Suggestions for de | 320.85714285714283 | 319.2857142857143
   Stemming en | 600.7142857142857 | 635.5714285714286
   Multi-threaded stemming en | 531.5714285714286 | 554.8571428571429
   Spellchecking en | 449.14285714285717 | 461.0
   Suggestions for en | 835.8571428571429 | 821.5714285714286
   Stemming fr | 718.0 | 709.2857142857143
   Multi-threaded stemming fr | 675.1428571428571 | 665.8571428571429
   Spellchecking fr | 260.85714285714283 | 263.0
   Suggestions for fr | 931.2857142857143 | 897.8571428571429
   Stemming ru | 1044.0 | 1027.5714285714287
   Multi-threaded stemming ru | 919.1428571428571 | 893.1428571428571
   Spellchecking ru | 583.4285714285714 | 573.0
   Suggestions for ru | 800.7142857142857 | 784.4285714285714
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to 
Contribute](https://wiki.apache.org/lucene/HowToContribute) and my code 
conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request 
title.
   - [x] I have given Lucene maintainers 
[access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
 to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to