diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-06-29 12:38:48 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-06-30 14:59:27 +0300 |
commit | a34c61d9c6ff16d858faada0483a3230294f5988 (patch) | |
tree | 0073bb1cdbc7e2888f52cb9e7e5de8765b00f072 | |
parent | 16c71a3bab31ab909200fc319f04084e3931e04e (diff) |
Reuse HTML Pipeline object in Markdown parser
The patches reduces pressure on GC and reduces markdown processing time
-rw-r--r-- | lib/gitlab/markdown.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index fa9c0975bb8..889decc9b48 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -54,7 +54,7 @@ module Gitlab current_user: current_user ) - pipeline = HTML::Pipeline.new(filters) + @pipeline ||= HTML::Pipeline.new(filters) context = { # SanitizationFilter @@ -79,7 +79,7 @@ module Gitlab project_wiki: @project_wiki } - result = pipeline.call(text, context) + result = @pipeline.call(text, context) save_options = 0 if options[:xhtml] |