Skip to content

Use Nokogiri as the ActiveSupport XML backend

Stan Hu requested to merge sh-use-nokogiri-xml-backend into master

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.

I also expect a significant memory reduction as well because after 10 minutes, the memory profile didn't even complete with the old REXML backend, but Nokogiri finished with about 150 MB of memory use for 241 JUnit files. See https://gitlab.com/gitlab-org/gitlab-ce/issues/54068 for the graphs of the ReactiveCachingWorker.

From the ruby-prof, we see a drop from 72% to 38% of the total time to process 241 JUnit files via Hash#from_xml:

Before

image

After

image

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54068

Edited by Stan Hu

Merge request reports