MCPcopy Create free account
hub / github.com/argumentcomputer/ix / item_cost_bytes

Function item_cost_bytes

zisk/host/src/main.rs:320–328  ·  view source on GitHub ↗

Structural cost estimate for one work item, in serialized-AST bytes. For a Standalone item that's the byte length of its primary const; for a Muts block it's the sum across all member + ctor projections. Reads `LazyConstant::raw_bytes().len()` (O(1) per target) — no parse, no allocation. Why bytes are a usable proxy for kernel cycles: body size scales with AST node count, which scales with WHNF

(env: &IxonEnv, item: &AnonWorkItem)

Source from the content-addressed store, hash-verified

318 let end = (start + shard_consts).min(total);
319 out.push((start, end));
320 start = end;
321 }
322 out
323}
324
325/// Structural cost estimate for one work item, in serialized-AST bytes.
326///
327/// For a Standalone item that's the byte length of its primary const;
328/// for a Muts block it's the sum across all member + ctor projections.
329/// Reads `LazyConstant::raw_bytes().len()` (O(1) per target) — no parse,
330/// no allocation.
331///

Callers 2

plan_shards_by_costFunction · 0.85
plan_inputFunction · 0.85

Calls 6

targetsMethod · 0.80
raw_bytesMethod · 0.80
valueMethod · 0.80
iterMethod · 0.45
getMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected