Pagy Comparisons

In this page we show and/or compare different aspects of the Pagy gem:

  • Helpers
  • Templates
  • (your) Custom Templates
  • Other Methods (benchmarks and profiles)

You can use this page to inspect the commented source, and make decision about using one method or another, based on Benchmarks and Memory allocation.

Nav Helpers

pagy_nav

Javascript Nav Helpers

Resize the windodw to get different quantities of pages shown...

pagy_nav_js
pagy_bootstrap_nav_js

Javascript Combo Nav Helpers

pagy_plain_compact_nav
pagy_bootstrap_combo_nav_js

Pagy Templates

nav.html.erb
nav.html.haml
nav.html.slim
bootstrap_nav.html.erb
bootstrap_nav.html.haml

Comparisons

IPS - Nav Methods

pagy_nav / pagy-template
Warming up -------------------------------------- pagy_nav 420.000 i/100ms pagy-template 277.000 i/100ms Calculating ------------------------------------- pagy_nav 4.209k (± 3.7%) i/s - 21.000k in 5.045976s pagy-template 2.752k (± 2.9%) i/s - 13.850k in 5.071338s with 99.0% confidence Comparison: pagy_nav: 4208.9 i/s pagy-template: 2751.5 i/s - 1.53x (± 0.07) slower with 99.0% confidence

Memory - Nav Methods

pagy_nav / pagy-template
Memory ----------------------------------- pagy_nav 27.06 Kb pagy-template 26.37 Kb - 1x more Objects ----------------------------------- pagy_nav 260 pagy-template 296 - 1.14x more

IPS - Link Methods

Memory - Link Methods

IPS - I18n Methods

pagy_t / rails-t
Warming up -------------------------------------- pagy_t 27.715k i/100ms rails-t 1.720k i/100ms Calculating ------------------------------------- pagy_t 323.021k (± 2.3%) i/s - 1.635M in 5.086475s rails-t 17.762k (± 2.6%) i/s - 89.440k in 5.067770s with 99.0% confidence Comparison: pagy_t: 323020.6 i/s rails-t: 17761.7 i/s - 18.19x (± 0.63) slower with 99.0% confidence

Memory - I18n Methods

pagy_t / rails-t
Memory ----------------------------------- pagy_t 0.59 Kb rails-t 5.62 Kb - 9.59x more Objects ----------------------------------- pagy_t 7 rails-t 46 - 6.57x more