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
[C#] Reduce allocations when using ArrayPool #34636
Comments
CurtHagenlocher
added a commit
to CurtHagenlocher/arrow
that referenced
this issue
Dec 10, 2023
Implement apacheGH-39144: Consistently pass CancellationToken through async calls.
CurtHagenlocher
added a commit
that referenced
this issue
Dec 10, 2023
### Rationale for this change GH-34636 is a great suggestion for simplifying the code and making it more efficient by changing the delegate-based RentReturn pattern to a "using"-based one. As most of the affected call sites were the ones not passing CancellationToken properly, it was a good time to fix that as well. ### Are these changes tested? This is basically a refactoring which doesn't add new functionality and so is covered by existing tests. Closes #39144 * Closes: #34636 Authored-by: Curt Hagenlocher <curt@hagenlocher.org> Signed-off-by: Curt Hagenlocher <curt@hagenlocher.org>
mapleFU
pushed a commit
to mapleFU/arrow
that referenced
this issue
Dec 13, 2023
…39166) ### Rationale for this change apacheGH-34636 is a great suggestion for simplifying the code and making it more efficient by changing the delegate-based RentReturn pattern to a "using"-based one. As most of the affected call sites were the ones not passing CancellationToken properly, it was a good time to fix that as well. ### Are these changes tested? This is basically a refactoring which doesn't add new functionality and so is covered by existing tests. Closes apache#39144 * Closes: apache#34636 Authored-by: Curt Hagenlocher <curt@hagenlocher.org> Signed-off-by: Curt Hagenlocher <curt@hagenlocher.org>
clayburn
pushed a commit
to clayburn/arrow
that referenced
this issue
Jan 23, 2024
…39166) ### Rationale for this change apacheGH-34636 is a great suggestion for simplifying the code and making it more efficient by changing the delegate-based RentReturn pattern to a "using"-based one. As most of the affected call sites were the ones not passing CancellationToken properly, it was a good time to fix that as well. ### Are these changes tested? This is basically a refactoring which doesn't add new functionality and so is covered by existing tests. Closes apache#39144 * Closes: apache#34636 Authored-by: Curt Hagenlocher <curt@hagenlocher.org> Signed-off-by: Curt Hagenlocher <curt@hagenlocher.org>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this issue
Feb 19, 2024
…39166) ### Rationale for this change apacheGH-34636 is a great suggestion for simplifying the code and making it more efficient by changing the delegate-based RentReturn pattern to a "using"-based one. As most of the affected call sites were the ones not passing CancellationToken properly, it was a good time to fix that as well. ### Are these changes tested? This is basically a refactoring which doesn't add new functionality and so is covered by existing tests. Closes apache#39144 * Closes: apache#34636 Authored-by: Curt Hagenlocher <curt@hagenlocher.org> Signed-off-by: Curt Hagenlocher <curt@hagenlocher.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the enhancement requested
Quick single-use buffers are rented using helper methods that cause a (small) allocation on every invocation due to the delegate capturing references to the reader/writer and other related variables. This somewhat defeats the purpose of using pooled arrays, especially small ones for quick operations such as reading the message length.
Here's a reference implementation for achieving roughly the same convenience without any allocations (outside the ones the pool might make):
Example usage:
Component(s)
C#
The text was updated successfully, but these errors were encountered: