MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / main

Function main

atomic-core/examples/graph_codec_lab.rs:168–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166 })
167}
168fn main() -> Result<()> {
169 let source = std::env::args()
170 .nth(1)
171 .context("usage: graph_codec_lab <change-file-or-directory>")?;
172 let mut paths = vec![];
173 collect(Path::new(&source), &mut paths)?;
174 paths.sort();
175 ensure!(!paths.is_empty(), "no change files");
176 let mut rows = vec![];
177 let mut failures = vec![];
178 for path in paths {
179 match measure(&path).with_context(|| path.display().to_string()) {
180 Ok(row) => {
181 eprintln!(
182 "{}: graph {} -> {} bytes",
183 path.display(),
184 row.graph_bytes,
185 row.candidate_graph_bytes
186 );
187 rows.push(row);
188 }
189 Err(error) => {
190 eprintln!("{error:#}");
191 failures.push(format!("{error:#}"));
192 }
193 }
194 }
195 println!(
196 "{}",
197 serde_json::to_string_pretty(
198 &serde_json::json!({"experiment":"graph field-context columns; NOT production","zstd_level":3,
199 "comparison":"unsigned frozen schema-2/3/4 ATSC-v1 baseline; full prototype headers counted; exact graph payload reconstruction; smaller-of-raw fallback; no operations coalesced",
200 "rows":rows,"failures":failures})
201 )?
202 );
203 ensure!(failures.is_empty(), "input failures; partial results only");
204 Ok(())
205}

Callers

nothing calls this directly

Calls 7

sortMethod · 0.80
displayMethod · 0.80
collectFunction · 0.70
measureFunction · 0.70
contextMethod · 0.45
with_contextMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected