Skip to content

Instantly share code, notes, and snippets.

@akm
Created December 17, 2018 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akm/a3c9e338bec8496000d80613d78d2712 to your computer and use it in GitHub Desktop.
Save akm/a3c9e338bec8496000d80613d78d2712 to your computer and use it in GitHub Desktop.
require 'benchmark'
n = 50_000
Benchmark.bm do |x|
x.report { n.times{ I18n.t('controller.acquisitions.cancel_execution') } }
x.report { n.times{ I18n.t(:cancel_execution, scope: 'controller.acquisitions') } }
x.report { n.times{ I18n.t(:cancel_execution, scope: "controller.acquisitions") } }
x.report { n.times{ I18n.t(:cancel_execution, scope: [:controller, :acquisitions]) } }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment