Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-06-29 12:38:48 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-06-30 14:59:27 +0300
commita34c61d9c6ff16d858faada0483a3230294f5988 (patch)
tree0073bb1cdbc7e2888f52cb9e7e5de8765b00f072 /lib
parent16c71a3bab31ab909200fc319f04084e3931e04e (diff)
Reuse HTML Pipeline object in Markdown parser
The patches reduces pressure on GC and reduces markdown processing time
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown.rb4
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]