{"push_id":1278022878,"size":70,"distinct_size":70,"ref":"refs/heads/master","head":"897ac0ed19e27f782bd3f5131a67b8c9a57f66d3","before":"3fc414a019526e5584867b032a188adf15c71eac","commits":[{"sha":"fa9f1538f034667ea5d55838bd46844642b54274","author":{"name":"Ryan De Villa","email":"1db3012d19fb599bea8462bda73447912aebed5f@nulogy.com"},"message":"Fix performance regression in `TimeWithZone#to_time`\n\nA performance regression was introduced by commit b79adc4323ff289aed3f5787fdfbb9542aa4f89f\nfrom Rails 4.0.0.beta1, in which `TimeWithZone#to_time` no longer returns a\ncached instance attribute but instead coerces the value to `Time`. This\ncoerced value is not cached, and recomputation degrades the performance\nof comparisons between TimeWithZone objects.\n\nSee https://github.com/rails/rails/commit/b79adc4323ff289aed3f5787fdfbb9542aa4f89f#diff-3497a506c921a3a3e40fd517e92e4fe3R322\nfor the change in question.\n\nThe following benchmark, which reverts the change linked above, demonstrates\nthe performance regression:\n\n    require 'active_support/time'\n    require 'benchmark/ips'\n\n    utc = Time.utc(2000, 1, 1, 0)\n    time_zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']\n\n    twz = ActiveSupport::TimeWithZone.new(utc, time_zone)\n    twz2 = ActiveSupport::TimeWithZone.new(Time.utc(1999, 12, 31, 23, 59, 59), ActiveSupport::TimeZone['UTC'])\n\n    patchedTimeWithZone = Class.new(ActiveSupport::TimeWithZone) do\n      def to_time\n        utc\n      end\n    end\n\n    patched_twz = patchedTimeWithZone.new(utc, time_zone)\n    patched_twz2 = patchedTimeWithZone.new(Time.utc(1999, 12, 31, 23, 59, 59), ActiveSupport::TimeZone['UTC'])\n\n    Benchmark.ips do |x|\n      x.report(\"comparison out of the box\") { twz <=> twz2 }\n      x.report(\"comparison reverting to_time\") { patched_twz <=> patched_twz2 }\n      x.compare!\n    end\n\nThe results, when run in rails-dev-box, are as follows:\n\n    Warming up --------------------------------------\n    comparison out of the box\n                            24.765k i/100ms\n    comparison reverting to_time\n                            57.237k i/100ms\n    Calculating -------------------------------------\n    comparison out of the box\n                            517.245k (± 4.7%) i/s -      2.600M in   5.038700s\n    comparison reverting to_time\n                              2.624M (± 5.0%) i/s -     13.050M in   4.985808s\n\n    Comparison:\n    comparison reverting to_time:  2624266.1 i/s\n    comparison out of the box:   517244.6 i/s - 5.07x slower\n\nThe change made to run the benchmark, however, is not possible, as it would\nundo the intent to standardize the return value of `to_time` to `Time` in\nthe system timezone.\n\nOur proposed solution is to restore the caching behaviour of `to_time`\nas it existed prior to the change linked above.\n\nBenchmark of our solution:\n\n    require 'active_support/time'\n    require 'benchmark/ips'\n\n    patchedTimeWithZone = Class.new(ActiveSupport::TimeWithZone) do\n      def to_time\n        @to_time ||= super\n      end\n    end\n\n    utc = Time.utc(2000, 1, 1, 0)\n    time_zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']\n\n    twz = ActiveSupport::TimeWithZone.new(utc, time_zone)\n    twz2 = ActiveSupport::TimeWithZone.new(Time.utc(1999, 12, 31, 23, 59, 59), ActiveSupport::TimeZone['UTC'])\n\n    patched_twz = patchedTimeWithZone.new(utc, time_zone)\n    patched_twz2 = patchedTimeWithZone.new(Time.utc(1999, 12, 31, 23, 59, 59), ActiveSupport::TimeZone['UTC'])\n\n    Benchmark.ips do |x|\n      x.report(\"TimeWithZone comparison - existing implementation\") { twz <=> twz2 }\n      x.report(\"TimeWithZone comparison - caching implementation\") { patched_twz <=> patched_twz2 }\n      x.compare!\n    end\n\nResults in rails-dev-box:\n\n    Warming up --------------------------------------\n    TimeWithZone comparison - existing implementation\n                            26.629k i/100ms\n    TimeWithZone comparison - caching implementation\n                            59.144k i/100ms\n    Calculating -------------------------------------\n    TimeWithZone comparison - existing implementation\n                            489.757k (± 4.2%) i/s -      2.450M in   5.011639s\n    TimeWithZone comparison - caching implementation\n                              2.802M (± 5.3%) i/s -     13.958M in   4.996116s\n\n    Comparison:\n    TimeWithZone comparison - caching implementation:  2801519.1 i/s\n    TimeWithZone comparison - existing implementation:   489756.7 i/s - 5.72x slower","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/fa9f1538f034667ea5d55838bd46844642b54274"},{"sha":"af054a5ae9a60b1a3bc84f0db8b518315d5e172e","author":{"name":"Ryan De Villa","email":"1db3012d19fb599bea8462bda73447912aebed5f@nulogy.com"},"message":"Memoize coerced TimeWithZone value in TimeWithZone#localtime.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/af054a5ae9a60b1a3bc84f0db8b518315d5e172e"},{"sha":"402852fc6d3222a283b65d407ffec3161946db71","author":{"name":"Ryuta Kamizono","email":"eaaec3c25cb0fb33a7ca3dcb58ed29b01ce2c843@gmail.com"},"message":"Add `Type.default_value` and use it everywhere for internal\n\nFor reduce instantiating `Type::Value`.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/402852fc6d3222a283b65d407ffec3161946db71"},{"sha":"a1eebd42c8b8edb57b2d213f150828b6d9e6f712","author":{"name":"Ryuta Kamizono","email":"eaaec3c25cb0fb33a7ca3dcb58ed29b01ce2c843@gmail.com"},"message":"Use splat `options` hash for `has_and_belongs_to_many`\n\nFor simplicity.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/a1eebd42c8b8edb57b2d213f150828b6d9e6f712"},{"sha":"a94fe2971b24d2a7827e205e7898e1b22771ed72","author":{"name":"James Coleman","email":"a4c2ab10343784117e12c22a304f098d6fef86a7@gmail.com"},"message":"Don't unnecessarily load a belongs_to when saving.\n\nPreviously, if the the association was previously loaded and then\nthe foreign key changed by itself, a #save call would trigger a\nload of the new associated record during autosave. This is unnecessary\nand the autosave code (in that case) didn't use the loaded record\nanyways.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/a94fe2971b24d2a7827e205e7898e1b22771ed72"},{"sha":"5de741c4cd4528fd86cae1091cdea984449cc926","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Allow a more explicit public behavior\n\nWe want to make it more explicit when a user wants to avoid the asset pipeline to do this we will add `public_*` methods to all path helpers. So if someone wants to use an asset that isn't maintained by the asset pipeline they can use `public_asset_path` instead of `asset_path` and letting it fall through.\n\nThe main reason for this change is the desire to raise helpful errors in the future. Right now if you typo an asset name, then we assume you intended an asset in the `public/` folder and not in the pipeline so nothing fails and the error sits silently until you realize the page didn't render correctly. We have to deprecate today so we can raise meaningful error messages in the future.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/5de741c4cd4528fd86cae1091cdea984449cc926"},{"sha":"4b84ef6d8bdad08a4b9860c6545a08f26a963d34","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Make sure routes don't interfere with paths","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/4b84ef6d8bdad08a4b9860c6545a08f26a963d34"},{"sha":"5b576af97efe7ff5375572ad325b18429e9a75a8","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Add descriptive comment","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/5b576af97efe7ff5375572ad325b18429e9a75a8"},{"sha":"e4b233a2523960b604d8829a5a23d329fba52d23","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Add public URL helpers","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/e4b233a2523960b604d8829a5a23d329fba52d23"},{"sha":"b8905f3c85e0bdd96c01ca181eda91705db0bc74","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Add docs to `public_*_path` methods & fix comments","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/b8905f3c85e0bdd96c01ca181eda91705db0bc74"},{"sha":"e8b081133a6780b37d1143becf4cfc945c41cb49","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Match method signature","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/e8b081133a6780b37d1143becf4cfc945c41cb49"},{"sha":"0a633b324eb8239a467fa7fbb9fa18abcd5759d3","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Test `public_` methods.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/0a633b324eb8239a467fa7fbb9fa18abcd5759d3"},{"sha":"9b22681cfc6b98343a8de0fbc0e2527aa688f36a","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Add `public_*` helpers to all the `_tag` methods.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/9b22681cfc6b98343a8de0fbc0e2527aa688f36a"},{"sha":"a22164a282b013e1b3305ea457b84656fba12c2e","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Fix formatting","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/a22164a282b013e1b3305ea457b84656fba12c2e"},{"sha":"b47970294e53ed9142ed16a560a8f68b1ae1b5d0","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Favor  `public_folder: true` over `public_*`\n\nAdding all those `public_*` methods is a bit heavy handed, we can change the API to instead  use `public_folder: true`. Change was pretty easy since it was already implemented that way.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/b47970294e53ed9142ed16a560a8f68b1ae1b5d0"},{"sha":"85f142019ff172ff8518535ceb878bfe205aef14","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Missed 2 public_* methods in cleanup","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/85f142019ff172ff8518535ceb878bfe205aef14"},{"sha":"fc16af47ba941ce8c0125653fa3bf399d68a586c","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Default assets.unknown_asset_fallback to false","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/fc16af47ba941ce8c0125653fa3bf399d68a586c"},{"sha":"44840cc85aaadd81b248cbce655155b6d259e596","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Do not deprecate using assets with leading slash","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/44840cc85aaadd81b248cbce655155b6d259e596"},{"sha":"53152dccd205564d23c643c492818ff405e40ebf","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Fully document asset_path.","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/53152dccd205564d23c643c492818ff405e40ebf"},{"sha":"129e6ead3e7931121da792d0eaa42ca3a2934c94","author":{"name":"schneems","email":"c14a41698892ba9bb4ba113f863cf6ac7adc56d2@gmail.com"},"message":"Fix initializer","distinct":true,"url":"https://api.github.com/repos/rafamanzo/rails/commits/129e6ead3e7931121da792d0eaa42ca3a2934c94"}]}
{"actor":{"display_login":"rafamanzo"}}