Reuse HTML Pipeline object in Markdown parser
The patches reduces pressure on GC and reduces markdown processing time
This commit is contained in:
parent
16c71a3bab
commit
a34c61d9c6
1 changed files with 2 additions and 2 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue