{"action":"created","issue":{"url":"https://api.github.com/repos/RubyMoney/money/issues/666","repository_url":"https://api.github.com/repos/RubyMoney/money","labels_url":"https://api.github.com/repos/RubyMoney/money/issues/666/labels{/name}","comments_url":"https://api.github.com/repos/RubyMoney/money/issues/666/comments","events_url":"https://api.github.com/repos/RubyMoney/money/issues/666/events","html_url":"https://github.com/RubyMoney/money/pull/666","id":191102415,"number":666,"title":"Cache I18n calls for better performance","user":{"login":"antstorm","id":118353,"avatar_url":"https://avatars.githubusercontent.com/u/118353?v=3","gravatar_id":"","url":"https://api.github.com/users/antstorm","html_url":"https://github.com/antstorm","followers_url":"https://api.github.com/users/antstorm/followers","following_url":"https://api.github.com/users/antstorm/following{/other_user}","gists_url":"https://api.github.com/users/antstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/antstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antstorm/subscriptions","organizations_url":"https://api.github.com/users/antstorm/orgs","repos_url":"https://api.github.com/users/antstorm/repos","events_url":"https://api.github.com/users/antstorm/events{/privacy}","received_events_url":"https://api.github.com/users/antstorm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-22T19:31:34Z","updated_at":"2016-12-19T10:35:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/RubyMoney/money/pulls/666","html_url":"https://github.com/RubyMoney/money/pull/666","diff_url":"https://github.com/RubyMoney/money/pull/666.diff","patch_url":"https://github.com/RubyMoney/money/pull/666.patch"},"body":"I18n calls are quite expensive, so caching this gives us an increase in performance of about 20%. Here's an example:\r\n\r\n```ruby\r\nres = Benchmark.measure do\r\n  100_000.times do\r\n    Money.euro(250).format\r\n  end\r\nend\r\nputs res\r\n```\r\n\r\nWithout caching:\r\n\r\n```\r\n=> 17.560000   0.060000  17.620000 ( 17.639144)\r\n```\r\n\r\nwith caching:\r\n\r\n```\r\n=> 14.410000   0.040000  14.450000 ( 14.445001)\r\n```\r\n\r\nAlthough I had to remove the freeze on the empty Money object. The whole empty object pre-caching seems like a very premature optimization\r\n"},"comment":{"url":"https://api.github.com/repos/RubyMoney/money/issues/comments/267932577","html_url":"https://github.com/RubyMoney/money/pull/666#issuecomment-267932577","issue_url":"https://api.github.com/repos/RubyMoney/money/issues/666","id":267932577,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T10:35:27Z","updated_at":"2016-12-19T10:35:27Z","body":"\n[![Coverage Status](https://coveralls.io/builds/9338558/badge)](https://coveralls.io/builds/9338558)\n\nCoverage decreased (-0.002%) to 99.275% when pulling **05fec49e765bc6f1ef39724e6703daec1d7e5d8f on antstorm:precache-i18n-calls** into **b07a9d994f26768fcb746c9936d4bb664b629d0d on RubyMoney:master**.\n"}}
{"actor":{"display_login":"coveralls"}}