1. 10 8月, 2016 10 次提交
  2. 09 8月, 2016 28 次提交
  3. 08 8月, 2016 2 次提交
    • R
      Merge branch 'faster-cache-keys' into 'master' · fd3a2cf7
      Rémy Coutable 提交于
      Optimize "cache_key" using a concern
      
      ## What does this MR do?
      
      This MR adds a concern (used by Issue and Note) that provides an optimized version of Rails' `cache_key` method. See 77c8520e for more details.
      
      ## Are there points in the code the reviewer needs to double check?
      
      No, though a spell check would be appreciated.
      
      ## Why was this MR needed?
      
      When loading a lot of data from Redis (e.g. an issue with lots of notes) quite a large amount of time is spent in generating cache keys. This is due to multiple reasons such as:
      
      * Rails trying to figure out if it should use `updated_at` or `updated_on` using somewhat inefficient code
      * Rails relying on pluralization logic to figure out how to generate a cache namespace using a model name
      * Rails calling a whole bunch of methods in general in the process of generating cache keys
      
      In short, Rails is trying to cater to every possible use case, at the cost of performance.
      
      ## What are the relevant issue numbers?
      
      https://gitlab.com/gitlab-org/gitlab-ce/issues/13651 is not directly related but I ran into this `cache_key` problem when looking into said issue.
      
      See merge request !5715
      fd3a2cf7
    • J
      f04e9dad