From 314dbba969a64bd0a91f648cfb193639ff312cbd Mon Sep 17 00:00:00 2001 From: Alexey Kudinkin Date: Fri, 25 Oct 2024 13:31:29 -0700 Subject: [PATCH] Tidying up docs Signed-off-by: Alexey Kudinkin --- python/ray/data/_internal/output_buffer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/ray/data/_internal/output_buffer.py b/python/ray/data/_internal/output_buffer.py index f164300f413d..4355b6e0a233 100644 --- a/python/ray/data/_internal/output_buffer.py +++ b/python/ray/data/_internal/output_buffer.py @@ -89,10 +89,13 @@ def next(self) -> Block: # into appropriately sized ones: # # - (Finalized) Target blocks sliced from the original one - # are *copied* to avoid holding up original one + # and are *copied* to avoid referencing original blocks # - Temporary remainder of the block should *NOT* be copied - # such as to avoid repeatedly copying the remainder of the - # block, resulting in O(N^2) total bytes being copied + # such as to avoid repeatedly copying the remainder bytes + # of the block, resulting in O(M * N) total bytes being + # copied, where N is the total number of bytes in the original + # block and M is the number of blocks that will be produced by + # this iterator block_to_yield = block.slice(0, target_num_rows, copy=True) block_remainder = block.slice( target_num_rows, block.num_rows(), copy=False