MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / estimated_memory_bytes

Method estimated_memory_bytes

nodedb/src/engine/graph/olap/columns.rs:106–127  ·  view source on GitHub ↗

Estimated memory usage in bytes.

(&self)

Source from the content-addressed store, hash-verified

104
105 /// Estimated memory usage in bytes.
106 pub fn estimated_memory_bytes(&self) -> usize {
107 let f64_mem: usize = self
108 .f64_columns
109 .values()
110 .map(|c| c.values.len() * 8 + c.present.len() * 8)
111 .sum();
112 let i64_mem: usize = self
113 .i64_columns
114 .values()
115 .map(|c| c.values.len() * 8 + c.present.len() * 8)
116 .sum();
117 let str_mem: usize = self
118 .string_columns
119 .values()
120 .map(|c| {
121 let dict_mem: usize = c.dictionary.iter().map(|s| s.len() + 24).sum();
122 let idx_mem = c.indices.len() * 4;
123 dict_mem + idx_mem
124 })
125 .sum();
126 f64_mem + i64_mem + str_mem
127 }
128}
129
130impl Float64Column {

Callers

nothing calls this directly

Calls 3

sumMethod · 0.80
lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected