Benchmarks
GretelX against gretel, on the same trails.
Rendering a trail
bench/render.rb renders the same five-level trail (Home > Customers > Alice > Orders > Order 2026-0042) with gretel and with GretelX, and checks that both produce the same output. The <ol> is gretel’s breadcrumbs(style: :ol) against a ten-line helper over breadcrumb_trail. The JSON-LD is gretel’s structured_data(url_base:) (paths behind a prefix) against breadcrumb_json_ld (_url helpers), both encoded and escaped the same way.
| Render | Allocations | Time, YJIT off | Time, YJIT on |
|---|---|---|---|
gretel <ol> | 345 | 57.6 µs | 35.1 µs |
GretelX <ol> | 274 | 45.4 µs | 29.8 µs |
| gretel JSON-LD | 268 | 41.3 µs | 25.4 µs |
| GretelX JSON-LD | 287 | 43.3 µs | 29.5 µs |
Most of the JSON-LD gap comes from Rails’ _url helpers, which are slower than _path ones: building the BreadcrumbList from the levels accounts for 1.7 µs of it.
Running it again
From a checkout of the gem, once with YJIT off and once with it on:
bundle exec ruby bench/render.rb
bundle exec ruby --yjit bench/render.rb
Run each three times and keep the median. Numbers depend on the machine: compare the two gems on the same one, not against this table.