[PAUSED] Tell Reductionist to return the count as bytes#323
[PAUSED] Tell Reductionist to return the count as bytes#323
Conversation
…y and gives us the option to convert back to a vector using: count = list(np.frombuffer(count, dtype=np.int64))
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #323 +/- ##
==========================================
+ Coverage 93.13% 93.16% +0.02%
==========================================
Files 7 7
Lines 685 688 +3
==========================================
+ Hits 638 641 +3
Misses 47 47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@maxstack thanks very much for implementing the option - the option itself works a treat! But the use of it doesn't bring upon any improvement in performance, in face, @varsiha-sothilingam and myself have noticed that the old implement with binary stream popped into a list by cbor is a lot more memory efficient than it used to be, so we left this option out for now. Of course, once we start seeing used cases that really need some memory improvements, we'll look at using the option again, but for now I am keeping it off. Cheers again, Max 🍻 |
Description
Add an option to the API request instructing Reductionist to return the count as bytes instead of a vector of int64's
It's been made optional so it can be switched on and off, just in case this isn't the best solution - but we can try!
We can restore the vector of int64's with the following, which uses numpy int64's so considering we're pushing data back into numpy this will hopefully improve efficiency:
count = list(np.frombuffer(count, dtype=np.int64))
The PR adds this conversion such that it's always done - might be better for those with more PyAS knowledge to optionally run this only when count is needed to save gobbling up more memory unnecessarily.
Closes #316
Hopefully!
@valeriupredoi makred this PR as PAUSED since #323 (comment) - we should keep the branch active and up to date as much as possible though.
Before you get started
Checklist