1. 25 11月, 2014 1 次提交
  2. 24 11月, 2014 2 次提交
  3. 23 11月, 2014 4 次提交
  4. 22 11月, 2014 1 次提交
  5. 21 11月, 2014 4 次提交
  6. 20 11月, 2014 7 次提交
  7. 19 11月, 2014 7 次提交
  8. 18 11月, 2014 7 次提交
    • S
      PERF: stop allocating the string "id" over and over · 9aa2b2d7
      Sam 提交于
      9aa2b2d7
    • G
      Revert "[PERF] Speed up integer type casting from DB" · 3098579f
      Godfrey Chan 提交于
      This reverts commit 6f7910ae and 52c70d49.
      
      Query params are type cased through the same method, so this approach doesn't work.
      3098579f
    • G
      💅 Put escape clause first, keeps @sgrif happy 😁 · 52c70d49
      Godfrey Chan 提交于
      See comment on 6f7910ae
      52c70d49
    • G
      [PERF] Speed up integer type casting from DB · 6f7910ae
      Godfrey Chan 提交于
      We don't have the check the range when the value is coming from the DB, so
      override type_cast_from_database to short-circuit the extra work.
      
      type_cast_from_database (small)  3437507.5 (±29.2%) i/s -   14223135 in   4.996973s
      type_cast_from_database (large)  3158588.7 (±28.3%) i/s -   13265628 in   4.992121s
      type_cast (small)                 481984.8 (±14.2%) i/s -    2352012 in   5.005694s
      type_cast (large)                 477331.8 (±14.2%) i/s -    2332824 in   5.012365s
      
      Comparison:
      type_cast_from_database (small):  3437507.5 i/s
      type_cast_from_database (large):  3158588.7 i/s - 1.09x slower
      type_cast (small):                 481984.8 i/s - 7.13x slower
      type_cast (large):                 477331.8 i/s - 7.20x slower
      
      The difference is huge but the absolute gain is quite small. That being said
      this is a hotspot and it showed up on the radar when benchmarking discourse.
      6f7910ae
    • S
      Remove the unused second argument to `substitute_at` · eb26f24b
      Sean Griffin 提交于
      Oh hey, we got to remove some code because of that!
      eb26f24b
    • S
      rm `reorder_bind_params` · c01b20b6
      Sean Griffin 提交于
      Arel handles this for us automatically. Updated tests, as BindParam is
      no longer a subclass of SqlLiteral. We should remove the second argument
      to substitute_at entirely, as it's no longer used
      c01b20b6
    • S
      Force table creation in tests · bf149679
      Sean Griffin 提交于
      If something causes the teardown block to not get run (errors,
      interrupting test runs), we have to manually delete them, which is a
      pain.
      bf149679
  9. 17 11月, 2014 3 次提交
  10. 15 11月, 2014 4 次提交
    • S
      Don't freeze the same hash we use for memoization · 48f2620d
      Sean Griffin 提交于
      48f2620d
    • S
      Allow `LazyAttributeHash` to be marshalled · 895a53e7
      Sean Griffin 提交于
      `default_proc` makes a hash unmarshallable, and adds unneccessary
      overhead. Since we control all access to the hash, let's just handle it
      in that method. This has the side effect of improving performance on
      initialization (but not neccessarily on access). We'll need to profile
      further once the tests are passing.
      895a53e7
    • S
      Correctly determine if an attribute is uninitialized · 3f63ac4e
      Sean Griffin 提交于
      In real usage, we give the builder a types hash with a default value of
      `Type::Value.new`. This means we need to explicitly check for the key,
      rather than the truthiness of the type to determine if it's a known but
      uninitialized attribute
      3f63ac4e
    • S
      Reduce the amount of work performed when instantiating AR models · 0f29c216
      Sean Griffin 提交于
      We don't know which attributes will or won't be used, and we don't want
      to create massive bottlenecks at instantiation. Rather than doing *any*
      iteration over types and values, we can lazily instantiate the object.
      
      The lazy attribute hash should not fully implement hash, or subclass
      hash at any point in the future. It is not meant to be a replacement,
      but instead implement its own interface which happens to overlap.
      0f29c216