1. 25 9月, 2018 1 次提交
    • V
      Abandon TOP support. · 41b92914
      Vladimir Kochnev 提交于
      Initially, `TOP` was introduced to support `limit` for MSSQL database.
      Unlike PostgreSQL/MySQL/SQLite, MSSQL does not have native `LIMIT`/`OFFSET` support.
      The commit adding `TOP` is 1a246f71.
      
      However, it figured out that `TOP` implementation was weak and it's not sufficient
      to also support `OFFSET`, then `TOP` was substituted with
      `ROW_NUMBER()` subquery in be48ed30.
      This is a well known trick in MSSQL -
      https://stackoverflow.com/questions/2135418/equivalent-of-limit-and-offset-for-sql-server.
      
      So now we don't need this `visit_Arel_Nodes_Top` at all.
      It does nothing useful but also adds an extra space after `SELECT` when `LIMIT` is being
      used for **any** database.
      41b92914
  2. 23 9月, 2018 1 次提交
    • Y
      Enable `Performance/UnfreezeString` cop · 1b86d901
      yuuji.yaginuma 提交于
      In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`.
      
      ```ruby
      # frozen_string_literal: true
      
      require "bundler/inline"
      
      gemfile(true) do
        source "https://rubygems.org"
      
        gem "benchmark-ips"
      end
      
      Benchmark.ips do |x|
        x.report('+@') { +"" }
        x.report('dup') { "".dup }
        x.compare!
      end
      ```
      
      ```
      $ ruby -v benchmark.rb
      ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
      Warming up --------------------------------------
                        +@   282.289k i/100ms
                       dup   187.638k i/100ms
      Calculating -------------------------------------
                        +@      6.775M (± 3.6%) i/s -     33.875M in   5.006253s
                       dup      3.320M (± 2.2%) i/s -     16.700M in   5.032125s
      
      Comparison:
                        +@:  6775299.3 i/s
                       dup:  3320400.7 i/s - 2.04x  slower
      
      ```
      1b86d901
  3. 11 9月, 2018 1 次提交
  4. 09 9月, 2018 2 次提交
  5. 28 5月, 2018 1 次提交
  6. 26 4月, 2018 1 次提交
  7. 24 2月, 2018 2 次提交