1. 04 Apr, 2016 7 commits
    • Yorick Peterse's avatar
      Cleaned up caching in AbstractReferenceFilter · 915fd3f9
      Yorick Peterse authored
      Cleaning this up any further is a bit tricky as the caches in question
      should only be evaluated if RequestStore is actually enabled.
      915fd3f9
    • Yorick Peterse's avatar
      ede351a9
    • Yorick Peterse's avatar
      Cache default_issues_tracker? in Banzai · 7f0fd73e
      Yorick Peterse authored
      Every object processed by ExternalIssueReferenceFilter can return a
      different Project instance when calling "project". For example, every
      note processed will have it's own associated Project. If we were to
      cache Project#default_issues_tracker? on Project level this would have
      no impact on Markdown rendering timings as the cache would have to be
      built for every Project instance without it ever being re-used.
      
      To work around this we cache Project#default_issues_tracker? in
      Banzai::Filter::ExternalIssueReferenceFilter using the project's _id_
      instead of the whole object. This setup allows re-using of the cached
      data even when the Project instances used are different, as long as the
      actual project IDs are the same.
      7f0fd73e
    • Yorick Peterse's avatar
      Memoize object class titles · 9fa94326
      Yorick Peterse authored
      For an issue with around 200 notes this cuts down timings by around 150
      milliseconds.
      9fa94326
    • Yorick Peterse's avatar
      Cache Banzai class methods returning static data · 8c49eaa9
      Yorick Peterse authored
      These methods always return the same data for every class so there's no
      point in computing their values on every call.
      8c49eaa9
    • Yorick Peterse's avatar
      Refactor processing of various Banzai filters · 14114805
      Yorick Peterse authored
      These filters now use a single iteration over all the document nodes
      instead of multiple ones. This in turn allows variables to be re-used
      (e.g. links only have to be unescaped once). Combined with some other
      refactoring this can drastically reduce render timings.
      14114805
    • Yorick Peterse's avatar
      Cache Banzai projects/objects using RequestStore · 57bde0ce
      Yorick Peterse authored
      This was originally suggested by @ayufan and modified to be a bit
      cleaner and use RequestStore instead of a regular Hash.
      
      By caching the output of the two methods involved the number of queries
      is reduced significantly. For example, for an issue with 200 notes (of
      which 100 reference a number of merge requests) this cuts down the
      amount of queries from around 6300 to around 3300.
      57bde0ce
  2. 03 Apr, 2016 3 commits
  3. 02 Apr, 2016 3 commits
  4. 01 Apr, 2016 27 commits