Skip to content
Snippets Groups Projects
  1. Feb 18, 2020
  2. Feb 11, 2020
  3. Feb 07, 2020
  4. Oct 07, 2019
  5. Oct 01, 2019
  6. Sep 18, 2019
  7. Sep 16, 2019
  8. Sep 13, 2019
  9. Jul 02, 2019
  10. Nov 12, 2018
    • Yorick Peterse's avatar
      Turn reference regex constants into methods · 9aa705dd
      Yorick Peterse authored
      `Mentionable::ReferenceRegexes` used to define the following two
      constants:
      
      1. DEFAULT_PATTERN
      2. EXTERNAL_PATTERN
      
      These two constants were built using some of the class methods that
      reside in this same module. In EE we redefine one of these methods by
      using `prepend` at the start of the `ReferenceRegexes` module. This
      poses a problem: we can not move the `prepend` to the end of the file,
      because the constants later on depend on it.
      
      To resolve this problem, this commit turns these constants into class
      methods that memoize their results. This allows EE to redefine the
      appropriate methods before these two class methods are used, in turn
      allowing us to move the `prepend` to the end of the file.
      
      See https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8198 for more
      information.
      Unverified
      9aa705dd
  11. Nov 01, 2018
  12. Sep 06, 2018
  13. Aug 10, 2018
  14. Mar 21, 2018
  15. Jan 31, 2018
  16. Jul 24, 2017
  17. Jul 18, 2017
  18. Jul 05, 2017
  19. Jun 30, 2017
  20. Jun 01, 2017
  21. May 23, 2017
  22. Mar 10, 2017
  23. Jan 22, 2017
  24. Dec 16, 2016
  25. Oct 26, 2016
  26. Oct 19, 2016
  27. Jul 01, 2016
  28. Jun 16, 2016
  29. Jun 13, 2016
  30. Jun 03, 2016
  31. May 09, 2016
  32. May 06, 2016
  33. Apr 25, 2016
  34. Jan 19, 2016
    • Yorick Peterse's avatar
      Greatly improve external_issue_tracker performance · b4ee6f57
      Yorick Peterse authored
      This greatly improves the performance of Project#external_issue_tracker
      by moving most of the fields queried in Ruby to the database and letting
      the database handle all logic. Prior to this change the process of
      finding an external issue tracker was along the lines of the following:
      
      1. Load all project services into memory.
      2. Reduce the list to only services where "issue_tracker?" returns true
      3. Reduce the list from step 2 to service where "default?" returns false
      4. Find the first service where "activated?" returns true
      
      This has to two big problems:
      
      1. Loading all services into memory only to reduce the list down to a
         single item later on is a waste of memory (and slow timing wise).
      2. Calling Array#select followed by Array#reject followed by Array#find
         allocates extra objects when this really isn't needed.
      
      To work around this the following service fields have been moved to the
      database (instead of being hardcoded):
      
      * category
      * default
      
      This in turn means we can get the external issue tracker using the
      following query:
      
          SELECT *
          FROM services
          WHERE active IS TRUE
          AND default IS FALSE
          AND category = 'issue_tracker'
          AND project_id = XXX
          LIMIT 1
      
      This coupled with memoizing the result (just as before this commit)
      greatly reduces the time it takes for Project#external_issue_tracker to
      complete. The exact reduction depends on one's environment, but locally
      the execution time is reduced from roughly 230 ms to only 2 ms (= a
      reduction of almost 180x).
      
      Fixes gitlab-org/gitlab-ce#10771
      b4ee6f57
  35. Jan 06, 2016
  36. Dec 11, 2015
  37. Dec 10, 2015
Loading