1. 16 8月, 2016 4 次提交
  2. 09 8月, 2016 1 次提交
  3. 08 8月, 2016 1 次提交
    • Y
      Added concern for a faster "cache_key" method · 77c8520e
      Yorick Peterse 提交于
      This concern provides an optimized/simplified version of the "cache_key"
      method. This method is about 9 times faster than the default "cache_key"
      method.
      
      The produced cache keys _are_ different from the previous ones but this
      is worth the performance improvement. To showcase this I set up a
      benchmark (using benchmark-ips) that compares FasterCacheKeys#cache_key
      with the regular cache_key. The output of this benchmark was:
      
          Calculating -------------------------------------
                     cache_key     4.825k i/100ms
                cache_key_fast    21.723k i/100ms
          -------------------------------------------------
                     cache_key     59.422k (± 7.2%) i/s -    299.150k
                cache_key_fast    543.243k (± 9.2%) i/s -      2.694M
      
          Comparison:
                cache_key_fast:   543243.4 i/s
                     cache_key:    59422.0 i/s - 9.14x slower
      
      To see the impact on real code I applied these changes and benchmarked
      Issue#referenced_merge_requests. For an issue referencing 10 merge
      requests these changes shaved off between 40 and 60 milliseconds.
      77c8520e
  4. 29 7月, 2016 1 次提交
    • Y
      Method for returning issues readable by a user · 002ad215
      Yorick Peterse 提交于
      The method Ability.issues_readable_by_user takes a list of users and an
      optional user and returns an Array of issues readable by said user. This
      method in turn is used by
      Banzai::ReferenceParser::IssueParser#nodes_visible_to_user so this
      method no longer needs to get all the available abilities just to check
      if a user has the "read_issue" ability.
      
      To test this I benchmarked an issue with 222 comments on my development
      environment. Using these changes the time spent in nodes_visible_to_user
      was reduced from around 120 ms to around 40 ms.
      002ad215
  5. 12 7月, 2016 1 次提交
  6. 02 7月, 2016 1 次提交
  7. 01 7月, 2016 1 次提交
  8. 30 6月, 2016 1 次提交
  9. 23 6月, 2016 1 次提交
    • S
      Fix pagination on sorts with lots of ties · d7a5a28c
      Sean McGivern 提交于
      Postgres and MySQL don't guarantee that pagination with `LIMIT` and
      `OFFSET` will work if the ordering isn't unique. From the Postgres docs:
      
      > When using `LIMIT`, it is important to use an `ORDER BY` clause that
      > constrains the result rows into a unique order. Otherwise you will get
      > an unpredictable subset of the query's rows
      
      Before:
      
          [1] pry(main)> issues = 1.upto(Issue.count).map { |i| Issue.sort('priority').page(i).per(1).map(&:id) }.flatten
          [2] pry(main)> issues.count
          => 81
          [3] pry(main)> issues.uniq.count
          => 42
      
      After:
      
          [1] pry(main)> issues = 1.upto(Issue.count).map { |i| Issue.sort('priority').page(i).per(1).map(&:id) }.flatten
          [2] pry(main)> issues.count
          => 81
          [3] pry(main)> issues.uniq.count
          => 81
      d7a5a28c
  10. 21 6月, 2016 1 次提交
  11. 16 6月, 2016 2 次提交
  12. 14 6月, 2016 3 次提交
  13. 08 6月, 2016 1 次提交
    • A
      Fix pseudo n+1 queries with Note and Note Authors in issuables APIs · fade1a4c
      Alejandro Rodríguez 提交于
      This was not a clear cut n+1 query, given that if you're directly subscribed to all issues
      that the API is returning you never really need to check for the notes. However, if you're
      subscribed to _all_ of them, then for each issuable you need to go once to `notes`, and
      once to `users` (for the authors). By preemtively loading notes and authors, at worst you have
      1 extra query, and at best you saved 2n extra queries. We also took advantage of this preloading
      of notes when counting user notes.
      fade1a4c
  14. 06 6月, 2016 1 次提交
  15. 03 6月, 2016 3 次提交
  16. 01 6月, 2016 2 次提交
    • Y
      Refactor Participable · 580d2501
      Yorick Peterse 提交于
      There are several changes to this module:
      
      1. The use of an explicit stack in Participable#participants
      2. Proc behaviour has been changed
      3. Batch permissions checking
      
      == Explicit Stack
      
      Participable#participants no longer uses recursion to process "self" and
      all child objects, instead it uses an Array and processes objects in
      breadth-first order. This allows us to for example create a single
      Gitlab::ReferenceExtractor instance and pass this to any Procs. Re-using
      a ReferenceExtractor removes the need for running potentially many SQL
      queries every time a Proc is called on a new object.
      
      == Proc Behaviour Changed
      
      Previously a Proc in Participable was expected to return an Array of
      User instances. This has been changed and instead it's now expected that
      a Proc modifies the Gitlab::ReferenceExtractor passed to it. The return
      value of the Proc is ignored.
      
      == Permissions Checking
      
      The method Participable#participants uses
      Ability.users_that_can_read_project to check if the returned users have
      access to the project of "self" _without_ running multiple SQL queries
      for every user.
      580d2501
    • F
      Add leading comment space cop · 56f3b243
      Felipe Artur 提交于
      56f3b243
  17. 30 5月, 2016 2 次提交
  18. 25 5月, 2016 5 次提交
  19. 24 5月, 2016 1 次提交
  20. 13 5月, 2016 1 次提交
  21. 12 5月, 2016 2 次提交
  22. 10 5月, 2016 1 次提交
  23. 06 5月, 2016 1 次提交
  24. 27 4月, 2016 1 次提交
  25. 21 4月, 2016 1 次提交