Skip to content

fix OpenIntToDoubleHashMap probe hang after put/remove churn - #358

Open
insaf021 wants to merge 1 commit into
apache:masterfrom
insaf021:openint-hashmap-removed-slots
Open

insaf021 wants to merge 1 commit into
apache:masterfrom
insaf021:openint-hashmap-removed-slots

Conversation

@insaf021

Copy link
Copy Markdown
Contributor

OpenIntToDoubleHashMap and OpenIntToFieldHashMap decide when to resize from the live size alone, so put/remove churn of distinct keys (setEntry(i, 1.0); setEntry(i, 0.0) for i up to 999 on new OpenMapRealVector(1000), or the same on new OpenMapRealMatrix(100, 100)) turns every FREE slot into REMOVED and the next lookup or insert of an absent key probes forever; this counts removed slots and rebuilds the table once live plus removed entries pass the load factor, doubling it only when the live entries need the room.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.22%. Comparing base (f554608) to head (1c870f2).
⚠️ Report is 421 commits behind head on master.

Files with missing lines Patch % Lines
...ons/math4/legacy/linear/OpenIntToFieldHashMap.java 66.66% 4 Missing ⚠️
...ns/math4/legacy/linear/OpenIntToDoubleHashMap.java 83.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #358      +/-   ##
============================================
+ Coverage     86.54%   87.22%   +0.67%     
+ Complexity     9787       91    -9696     
============================================
  Files           532      499      -33     
  Lines         35516    33560    -1956     
  Branches       6194     5864     -330     
============================================
- Hits          30738    29273    -1465     
+ Misses         3518     3164     -354     
+ Partials       1260     1123     -137     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

2 participants