From 198f2a0b6149a2e7c069ad3aaad6ced9f5bb3ea1 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 15 Nov 2018 22:49:48 -0800 Subject: Use Nokogiri as the ActiveSupport XML backend This significantly improves performance and reduces memory consumption when parsing XML files. On a test with 124 JUnit files from a CE build, there was about a 4x reduction in processing time. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54068 --- config/application.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/application.rb b/config/application.rb index 1b084e91cfb..921baa5d617 100644 --- a/config/application.rb +++ b/config/application.rb @@ -158,6 +158,9 @@ module Gitlab config.action_view.sanitized_allowed_protocols = %w(smb) + # Nokogiri is significantly faster and uses less memory than REXML + ActiveSupport::XmlMini.backend = 'Nokogiri' + # This middleware needs to precede ActiveRecord::QueryCache and other middlewares that # connect to the database. config.middleware.insert_after Rails::Rack::Logger, ::Gitlab::Middleware::BasicHealthCheck -- cgit v1.2.3