-
Notifications
You must be signed in to change notification settings - Fork 295
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
Atomic nibble instead of mutex #1601
base: master
Are you sure you want to change the base?
Conversation
lib/storage.hh
Outdated
@@ -393,7 +403,7 @@ public: | |||
|
|||
Byte ** get_raw_tables() | |||
{ | |||
return _counts; | |||
return (Byte **)_counts; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely evil :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what to do about this. What is the use case for get_raw_tables()
beyond nosy devs wanting to peak inside?
the explicit rationale is somewhere in the merged pull request history...
seek answers there :)
|
Seems like this was the first time this came up: #667 From what I gather of the discussion there I don't think we can use the buffer interface to fake the "round up to nearest byte". Should we move it up the inheritance tree to expose it only for |
5229519
to
f422e07
Compare
I think this is reasonable. |
a870206
to
641436f
Compare
Ready for review! @luizirber, @camillescott, @standage , or @ctb |
988cf32
to
921bf9b
Compare
Codecov Report
@@ Coverage Diff @@
## master #1601 +/- ##
=========================================
- Coverage 70.11% 70.1% -0.01%
=========================================
Files 66 66
Lines 8906 8877 -29
Branches 3009 2999 -10
=========================================
- Hits 6244 6223 -21
- Misses 1040 1041 +1
+ Partials 1622 1613 -9
Continue to review full report at Codecov.
|
Use individual bytes that can be updated atomically instead of mutexes.
Node* or SmallCount* objects pack things into individual bytes which makes the raw table points unsuitable for numpy.frombuffer
ea7bb2d
to
f47c07c
Compare
NibbleStorage
uses a big (bad) mutex. This is pretty slow. This PR removes that and instead uses an array of atomic bytes.make test
Did it pass the tests?make clean diff-cover
If it introduces new functionality inscripts/
is it tested?make format diff_pylint_report cppcheck doc pydocstyle
Is it wellformatted?
additions are allowed without a major version increment. Changing file
formats also requires a major version number increment.
documented in
CHANGELOG.md
? See keepachangelogfor more details.
changes were made?
tested for streaming IO?)