Skip to content

[PAUSED] Tell Reductionist to return the count as bytes#323

Open
maxstack wants to merge 5 commits intomainfrom
reductionist_count_as_bytes
Open

[PAUSED] Tell Reductionist to return the count as bytes#323
maxstack wants to merge 5 commits intomainfrom
reductionist_count_as_bytes

Conversation

@maxstack
Copy link
Copy Markdown
Collaborator

@maxstack maxstack commented Mar 31, 2026

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

  • This pull request has a descriptive title and labels
  • This pull request has a minimal description (most was discussed in the issue, but a two-liner description is still desirable)
  • Unit tests have been added (if codecov test fails)
  • Any changed dependencies have been added or removed correctly (if need be)
  • If you are working on the documentation, please ensure the current build passes
  • All tests pass

…y and gives us the option to convert back to a vector using:

count = list(np.frombuffer(count, dtype=np.int64))
@maxstack maxstack requested a review from valeriupredoi March 31, 2026 11:25
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (ab85d39) to head (f5050ad).

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.
📢 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.

@valeriupredoi valeriupredoi added enhancement New feature or request testing testing duh wacasoft labels Mar 31, 2026
@valeriupredoi
Copy link
Copy Markdown
Collaborator

@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 🍻

@valeriupredoi valeriupredoi changed the title Tell Reductionist to return the count as bytes [PAUSED] Tell Reductionist to return the count as bytes Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request testing testing duh wacasoft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory tests with `axis: hijacking cbor output

2 participants