MCPcopy Create free account
hub / github.com/apache/arrow-rs / total_buffer_bytes_used

Method total_buffer_bytes_used

arrow-array/src/array/byte_view_array.rs:716–728  ·  view source on GitHub ↗

Returns the total number of bytes used by all non inlined views in all buffers. Note this does not account for views that point at the same underlying data in buffers For example, if the array has three strings views: View with length = 9 (inlined) View with length = 32 (non inlined) View with length = 16 (non inlined) Then this method would report 48

(&self)

Source from the content-addressed store, hash-verified

714 ///
715 /// Then this method would report 48
716 pub fn total_buffer_bytes_used(&self) -> usize {
717 self.views()
718 .iter()
719 .map(|v| {
720 let len = *v as u32;
721 if len > MAX_INLINE_VIEW_LEN {
722 len as usize
723 } else {
724 0
725 }
726 })
727 .sum()
728 }
729
730 /// Compare two [`GenericByteViewArray`] at index `left_idx` and `right_idx`
731 ///

Callers 4

set_sourceMethod · 0.80
gcMethod · 0.80
test_gc_huge_arrayFunction · 0.80

Calls 2

viewsMethod · 0.80
iterMethod · 0.45

Tested by 1

test_gc_huge_arrayFunction · 0.64