Skip to content

Snapshot::build_from add test to calculate overhead for listing only newer versions#1

Draft
gotocoding-DB wants to merge 1 commit intouse-next-version-for-build-fromfrom
calculate-overhead
Draft

Snapshot::build_from add test to calculate overhead for listing only newer versions#1
gotocoding-DB wants to merge 1 commit intouse-next-version-for-build-fromfrom
calculate-overhead

Conversation

@gotocoding-DB
Copy link
Copy Markdown
Owner

@gotocoding-DB gotocoding-DB commented Jan 21, 2026

TEST 1: Building snapshot WITHOUT checkpoint
========================================
Building snapshot at version 100000 (no checkpoints)...

Measuring memory usage...

=== Snapshot Memory Usage (NO CHECKPOINT) ===
Versions: 0-100000 (100001 commits)
Checkpoints: 0

Memory Breakdown:
  Stack memory:        3048 bytes (    2.98 KB)
  Heap memory:     35577593 bytes (34743.74 KB)
  Total memory:    35580641 bytes (34746.72 KB, 33.93 MB)

Per-commit average: 355.8 bytes

========================================
TEST 2: Creating checkpoint and rebuilding snapshot
========================================
Creating checkpoint at version 99800...
Building snapshot at version 100000 (with checkpoint at 99800)...

Measuring memory usage...

=== Snapshot Memory Usage (WITH CHECKPOINT) ===
Versions: 0-100000 (100001 total)
Checkpoint at: 99800
Commits in memory: 200 (versions 99801-100000)

Memory Breakdown:
  Stack memory:        3048 bytes (    2.98 KB)
  Heap memory:     23102800 bytes (22561.33 KB)
  Total memory:    23105848 bytes (22564.30 KB, 22.04 MB)

Per-commit average: 115529.2 bytes

========================================
COMPARISON
========================================
Memory saved by checkpoint: 12474793 bytes (12182.42 KB, 11.90 MB)
Commits saved from memory: 99801 commits
Memory reduction: 35.1%
test snapshot::tests::test_snapshot_memory_usage ... ok

@gotocoding-DB gotocoding-DB marked this pull request as draft January 21, 2026 14:15
@gotocoding-DB gotocoding-DB changed the title add test to calculate overhead Snapshot::build_from add test to calculate overhead for listing only newer versions Jan 21, 2026
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.

1 participant