Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: attributes_perf
Commits on Nov 3, 2012
  1. @jonleighton

    Don't allocate new strings in compiled attribute methods

    jonleighton authored
    This improves memory and performance without having to use symbols which
    present DoS problems. Thanks @headius and @tenderlove for the
    This was originally committed in
    f176501, and then reverted in
    d349490 due to it causing problems in a
    real application. This second attempt should solve that.
    require 'active_record'
    require 'benchmark/ips'
    ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
    class Post < ActiveRecord::Base
      connection.create_table :posts, force: true do |t|
        t.string :name
    post = Post.create name: 'omg'
    Benchmark.ips do |r|'')          { name: 'omg' }'')         { }'')        { = 'omg' }'Post.find(1).name') { Post.find(1).name }
    Calculating -------------------------------------
            1419 i/100ms
           7538 i/100ms
          3024 i/100ms
       Post.find(1).name       243 i/100ms
          20637.6 (±12.7%) i/s -     102168 in   5.039578s
       1167897.7 (±18.2%) i/s -    5186144 in   4.983077s
        64305.6 (±9.6%) i/s -     317520 in   4.998720s
       Post.find(1).name     2678.8 (±10.8%) i/s -      13365 in   5.051265s
    Calculating -------------------------------------
            1431 i/100ms
           7790 i/100ms
          3181 i/100ms
       Post.find(1).name       245 i/100ms
          21308.8 (±12.2%) i/s -     105894 in   5.053879s
       1534103.8 (±2.1%) i/s -    7634200 in   4.979405s
        67441.0 (±7.5%) i/s -     337186 in   5.037871s
       Post.find(1).name     2681.9 (±10.6%) i/s -      13475 in   5.084511s
Commits on Nov 2, 2012
  1. @rafaelfranca

    Merge pull request #8108 from Casecommons/fix-multiple-and-index-in-i…

    rafaelfranca authored
    Support :multiple option on input tags that also have :index
  2. @nertzy

    Support :multiple option on input tags with :index

    Daniel Fox, Grant Hutchins & Trace Wax authored nertzy committed
    When you have an explicit index set, then when you build an input tag
    with :multiple => true, it doesn't add [] to the end of its name, although
    it should.
  3. @rafaelfranca

    Remove old comment

    rafaelfranca authored
    This comment is not valid since that `if` is there to make possible to
        remove_index :users, :name
    Instead of:
        remove_index :users, column: :name
    What is a valid use case.
    [ci skip]
  4. @rafaelfranca

    Deprecate passing a string as third argument of `add_index`

    rafaelfranca authored
    This was there due historical reasons since
    7dc4581 to give the user the
    possibility to create unique indexes passing "UNIQUE" as the third
  5. @spastorino
  6. @rafaelfranca
  7. @carlosantoniodasilva

    Merge pull request #8106 from steveklabnik/fix_grammar

    carlosantoniodasilva authored
    Fixed grammar in migration pending error.
  8. @steveklabnik
  9. @vijaydev

    Merge branch 'master' of

    vijaydev authored
  10. @rafaelfranca
  11. @vijaydev

    copy edits [ci skip]

    vijaydev authored
  12. @vijaydev

    Revert "Updated activerecord test comments to new hash syntax"

    vijaydev authored
    This reverts commit 3b89052.
    Reason: changes made to a test, albeit in commented lines - non-uniform
    [ci skip]
  13. @vijaydev

    Revert "dont encourage AC::Parameters#permit_all_parameters usage [ci…

    vijaydev authored
    … skip]"
    This reverts commit cd17ee5.
    Reason: Let's note that this is discouraged, not remove the docs
    [ci skip]
  14. @rafaelfranca

    Revert "Merge pull request #7668 from Draiken/fix_issue_6497"

    rafaelfranca authored
    This reverts commit f4ad0eb, reversing
    changes made to 8b2cbb3.
    REASON: This added introduced a bug when you have a shorthand route
    inside a nested namespace.
  15. @rafaelfranca

    Merge pull request #8097 from steveklabnik/issue_8095

    rafaelfranca authored
    Fixed mapping of Solomon Islands.
  16. @steveklabnik

    Fixed timezone mapping of Solomon Islands.

    steveklabnik authored
    Fixes #8095.
    For reference, here is the discussion about the mapping being
Commits on Nov 1, 2012
  1. @spastorino

    Merge pull request #8019 from lest/patch-1

    spastorino authored
    memoize calculated ip without additional variable
  2. @lest

    memoize calculated ip without additional variable

    lest authored
    There is no need in additional `@calculated_ip` instance variable.
  3. @carlosantoniodasilva

    Fix issue with collection associations and first(n)/last(n)

    carlosantoniodasilva authored
    When calling first(n) or last(n) in a collection, Active Record was
    improperly trying to set the inverse of instance in case that option
    existed. This change was introduced by
    In such cases we don't need to do that "manually", since the way
    collection will be loaded will already handle that, so we just skip
    setting the inverse association when any argument is given to
    The test included ensures that these scenarios will have the inverse of
    instance set properly.
    Fixes #8087, Closes #8094.
    Squashed cherry-pick from d37d40b and c368b66.
  4. @kennyj
  5. @carlosantoniodasilva

    Merge pull request #8093 from nikitug/keep_app_x_ua_compatible

    carlosantoniodasilva authored
    Fix #8086 (BestStandardsSupport rewrites app X-UA-Compatible header)
  6. @nikitug

    Fix #8086 (BestStandardsSupport rewrites app X-UA-Compatible header, …

    nikitug authored
    …now appends).
    Now `BestStandardsSupport` middleware appends it's `X-UA-Compatible` value to app's value.
    Also test for `BestStandardsSupport` middleware added.
  7. @carlosantoniodasilva
  8. @spastorino

    Merge pull request #8092 from arunagw/warning_removed_unused_var

    spastorino authored
    Small change to remove warning unused variable.
  9. @arunagw
  10. @carlosantoniodasilva

    Merge pull request #8026 from steveklabnik/issue_8025

    carlosantoniodasilva authored
    Make sure that RAILS_ENV is set when accessing Rails.env
  11. @steveklabnik
Commits on Oct 31, 2012
  1. @AvnerCohen
  2. @dhh
  3. @dhh

    No need for the debugger

    dhh authored
  4. @dhh
  5. @guilleiguaran
  6. @carlosantoniodasilva
  7. @carlosantoniodasilva

    Merge pull request #8073 from alexisbernard/fix_find_in_batches_start…

    carlosantoniodasilva authored
    Fix find_in_batches against string IDs when start option is not specified
Something went wrong with that request. Please try again.