Skip to content

Ruby: Add arena_stats kwarg and --arena-stats CLI flag#1293

Merged
marcoroth merged 1 commit intomainfrom
arena-stats
Mar 4, 2026
Merged

Ruby: Add arena_stats kwarg and --arena-stats CLI flag#1293
marcoroth merged 1 commit intomainfrom
arena-stats

Conversation

@marcoroth
Copy link
Owner

@marcoroth marcoroth commented Mar 4, 2026

❯ bundle exec exe/herb parse examples/test.html.erb --silent --arena-stats
╔════════════════════════════════════════════════════════════════════════════════════════════════════╗
║                                        ARENA MEMORY LAYOUT                                         ║
╠════════════════════════════════════════════════════════════════════════════════════════════════════╣
║  Statistics:                                                                                       ║
║    • Pages: 1                                                                                      ║
║    • Default Page Size: 16 KB                                                                      ║
║    • Total Capacity: 16 KB                                                                         ║
║    • Total Used: 7 KB                                                                              ║
║    • Total Available: 8 KB                                                                         ║
║    • Usage: 44.6%                                                                                  ║
║    • Allocations: 274                                                                              ║
║    • Fragmentation: 0 B                                                                            ║
╠════════════════════════════════════════════════════════════════════════════════════════════════════╣
║  Page 0 @ 0x104b2c000 ← CURRENT                                                                    ║
║    [████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░]  7 KB / 16 KB (45%) ║
║    Unused: 8 KB (available for allocations)                                                        ║
║                                                                                                    ║
╚════════════════════════════════════════════════════════════════════════════════════════════════════╝
Success
irb(main):001> Herb.parse("<div></div>", arena_stats: true)
╔════════════════════════════════════════════════════════════════════════════════════════════════════╗
║                                        ARENA MEMORY LAYOUT                                         ║
╠════════════════════════════════════════════════════════════════════════════════════════════════════╣
║  Statistics:                                                                                       ║
║    • Pages: 1                                                                                      ║
║    • Default Page Size: 16 KB                                                                      ║
║    • Total Capacity: 16 KB                                                                         ║
║    • Total Used: 1 KB                                                                              ║
║    • Total Available: 14 KB                                                                        ║
║    • Usage: 8.0%                                                                                   ║
║    • Allocations: 48                                                                               ║
║    • Fragmentation: 0 B                                                                            ║
╠════════════════════════════════════════════════════════════════════════════════════════════════════╣
║  Page 0 @ 0x102f38000 ← CURRENT                                                                    ║
║    [█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░]  1 KB / 16 KB (8%) ║
║    Unused: 14 KB (available for allocations)                                                       ║
║                                                                                                    ║
╚════════════════════════════════════════════════════════════════════════════════════════════════════╝
=>
#<Herb::ParseResult:0x0000000121ad6ef8 ...>

@marcoroth marcoroth changed the title Ruby: Add arena_stats kwarg and --arena-stats CLi flag Ruby: Add arena_stats kwarg and --arena-stats CLI flag Mar 4, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

npx https://pkg.pr.new/@herb-tools/formatter@1293
npx https://pkg.pr.new/@herb-tools/language-server@1293
npx https://pkg.pr.new/@herb-tools/linter@1293

commit: 9b571db

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit 9b571db


✅ Preview deployment has been cleaned up.

@marcoroth marcoroth merged commit 1bb0b5b into main Mar 4, 2026
32 checks passed
@marcoroth marcoroth deleted the arena-stats branch March 4, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant