Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
## I18n backends benchmarks
#
# All these benchmarks were performed using REE with the suite at
# at http://github.com/svenfuchs/i18n/tree/master/benchmark/run.rb
#
# When compared to ActiveRecord backend, Redis and Tokyo
# just cannot store procs. All other tests pass.
#
# Used rufus-tokyo (1.0.7) and redis (2.0.0) as gems and N = 10.
===> I18n::Backend::ActiveRecord
store 1976.37 ms 1642037 objects
t (depth=3) 9.54 ms 9659 objects
t (depth=5) 9.50 ms 9659 objects
t (depth=7) 9.76 ms 9659 objects
t w/ default 9.98 ms 7539 objects
t w/ interpolation 11.83 ms 10299 objects
t w/ link 10.65 ms 9659 objects
t subtree 95.25 ms 46389 objects
===> I18n::Backend::Tokyo (using FFI)
store 485.60 ms 318733 objects
t (depth=3) 1.90 ms 689 objects
t (depth=5) 1.77 ms 689 objects
t (depth=7) 1.89 ms 689 objects
t w/ default 1.57 ms 529 objects
t w/ interpolation 2.40 ms 1379 objects
t w/ link 1.77 ms 729 objects
t subtree 47.94 ms 11399 objects
===> I18n::Backend::Tokyo (using native bindings)
store 410.06 ms 312527 objects
t (depth=3) 0.64 ms 609 objects
t (depth=5) 0.62 ms 609 objects
t (depth=7) 0.68 ms 609 objects
t w/ default 0.50 ms 459 objects
t w/ interpolation 1.11 ms 1299 objects
t w/ link 0.61 ms 649 objects
t subtree 7.55 ms 11319 objects
===> I18n::Backend::Redis
store 553.09 ms 396313 objects
t (depth=3) 2.64 ms 1099 objects
t (depth=5) 1.83 ms 1099 objects
t (depth=7) 1.84 ms 1099 objects
t w/ default 1.48 ms 939 objects
t w/ interpolation 2.35 ms 1789 objects
t w/ link 1.81 ms 1139 objects
t subtree 8.57 ms 11809 objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.