1. 21 2月, 2019 7 次提交
    • X
      Explains a detail re eager loading [ci skip] · 2420c44d
      Xavier Noria 提交于
      2420c44d
    • V
      Merge pull request #35342 from alkesh26/actionview-typo-fixes · 0f70b025
      Vipul A M 提交于
      [ci skip] actionview typo fixes.
      0f70b025
    • A
      [ci skip] actionview typo fixes. · 955eac5a
      alkesh26 提交于
      955eac5a
    • R
      More exercise test cases for order by table name qualified column name · 46508740
      Ryuta Kamizono 提交于
      This covers what #34626 fixes.
      46508740
    • R
      Merge pull request #35263 from hatch-carl/reduce-postgres-uuid-allocations · dfa857ef
      Ryuta Kamizono 提交于
      Reduce unused allocations when casting UUIDs for Postgres
      dfa857ef
    • R
      Merge pull request #35340 from cpruitt/fix-actionview-notimplemented-with-path-set · 5b756f43
      Rafael França 提交于
      Deprecate ActionView::PathSet as argument to ActionView::Base.new
      5b756f43
    • C
      Reduce unused allocations when casting UUIDs for Postgres · 6735a071
      Carl Thuringer 提交于
      Using the subscript method `#[]` on a string has several overloads and
      rather complex implementation. One of the overloads is the capability to
      accept a regular expression and then run a match, then return the
      receiver (if it matched) or one of the groups from the MatchData.
      
      The function of the `UUID#cast` method is to cast a UUID to a type and
      format acceptable by postgres. Naturally UUIDs are supposed to be
      string and of a certain format, but it had been determined that it was
      not ideal for the framework to send just any old string to Postgres and
      allow the engine to complain when "foobar" or "" was sent, being
      obviously of the wrong format for a valid UUID. Therefore this code was
      written to facilitate the checking, and if it were not of the correct
      format, a `nil` would be returned as is conventional in Rails.
      
      Now, the subscript method will allocate one or more strings on a match
      and return one of them, based on the index parameter. However, there
      is no need for a new string, as a UUID of the correct format is already
      such, and so long as the format was verified then the string supplied is
      adequate for consumption by the database.
      
      The subscript method also creates a MatchData object which will never be
      used, and so must eventually be garbage collected.
      
      Garbage collection indeed. This innocuous method tends to be called
      quite a lot, for example if the primary key of a table is a uuid, then
      this method will be called. If the foreign key of a relation is a UUID,
      once again this method is called. If that foreign key is belonging to
      a has_many relationship with dozens of objects, then again dozens of
      UUIDs shall be cast to a dup of themselves, and spawn dozens of
      MatchData objects, and so on.
      
      So, for users that:
      * Use UUIDs as primary keys
      * Use Postgres
      * Operate on collections of objects
      
      This accomplishes a significant savings in total allocations, and may
      save many garbage collections.
      6735a071
  2. 20 2月, 2019 22 次提交
  3. 19 2月, 2019 11 次提交