diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-22 22:11:05 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-22 22:17:05 -0700 |
commit | 4d376c667d72e0eca22b4abe76e0bf09434fc4bd (patch) | |
tree | f9f37dded36435a1b909e0219050816540c21c87 /config | |
parent | dc7b4b7bb97ead6fca1eefad5f56c8db5db00f93 (diff) | |
download | gitlab-ce-4d376c667d72e0eca22b4abe76e0bf09434fc4bd.tar.gz |
Remove method instrumentation for Banzai filters and reference parserssh-remove-banzai-instrumentation
For one README.md file, this instrumentation was adding several seconds and
significant RAM and CPU overhead since these filters often iterate through
all HTML nodes in tight loops.
Relates to #49409
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/8_metrics.rb | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index 8a851b89c56..fe37b7710aa 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -58,20 +58,6 @@ def instrument_classes(instrumentation) instrumentation.instrument_instance_methods(const) end - # Instruments all Banzai filters and reference parsers - { - Filter: Rails.root.join('lib', 'banzai', 'filter', '*.rb'), - ReferenceParser: Rails.root.join('lib', 'banzai', 'reference_parser', '*.rb') - }.each do |const_name, path| - Dir[path].each do |file| - klass = File.basename(file, File.extname(file)).camelize - const = Banzai.const_get(const_name).const_get(klass) - - instrumentation.instrument_methods(const) - instrumentation.instrument_instance_methods(const) - end - end - instrumentation.instrument_methods(Banzai::Renderer) instrumentation.instrument_methods(Banzai::Querying) |