Skip to content

perf: measure memory usage on large inputs - #123

Merged
Ayinkx01 merged 3 commits into
mainfrom
perf/measure-memory-large-inputs
Sep 22, 2026
Merged

Ayinkx01 merged 3 commits into
mainfrom
perf/measure-memory-large-inputs

Conversation

@Ayinkx

@Ayinkx Ayinkx commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Closes #109

What

Measures memory on large decode inputs and reports it per input size.

  • crates/devkit-xdr/examples/mem_profile.rs: decodes large base64 ScVal::Bytes inputs at several sizes and prints CSV (size_bytes, base64_bytes, decoded_json_bytes, current_bytes, peak_bytes, delta_current_bytes).
  • Uses platform APIs: Linux /proc/self/status (VmRSS/VmHWM) and Windows GetProcessMemoryInfo (WorkingSetSize/PeakWorkingSetSize). Other platforms fall back to n/a with a clear note, so the example still builds and runs.
  • docs/MEMORY.md: methodology, platform table, and documented limits.

Verification

  • cargo run -p devkit-xdr --example mem_profile -- 1024,262144,1048576 reports memory per size; observed peak grew 5.08 MB -> 6.34 MB -> 10.33 MB.
  • cargo fmt --all -- --check clean
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo test --all --all-features pass

Add a devkit-xdr example that decodes large base64 ScVal inputs and reports peak/current memory per input size using platform APIs (Linux /proc/self/status, Windows GetProcessMemoryInfo) with a documented fallback. Document methodology and limits in docs/MEMORY.md. Closes #109
…arge-inputs

# Conflicts:
#	CHANGELOG.md
#	README.md
@Ayinkx01
Ayinkx01 merged commit af563eb into main Sep 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: measure memory usage on large inputs

2 participants