Class: PerformanceComparator

Inherits:
Object
  • Object
show all
Defined in:
lib/tasks/performance_comparator.rb

Constant Summary collapse

REPO_ROOT =
File.expand_path(File.join(__dir__, "..", ".."))
DEFAULT_RUN_TIME =

seconds

10
DEFAULT_THRESHOLD =

10% (more lenient for complex operations)

0.10
DEFAULT_BASE =
"main"
TMP_PERF_DIR =
File.join(REPO_ROOT, "tmp", "performance")
BENCH_SCRIPT =
File.join(TMP_PERF_DIR, "benchmark_runner.rb")
BENCHMARK_CATEGORIES =

Benchmark categories - run specific subsets

{
  xml_parsing: %w[xml_parse_dom_simple xml_parse_sax_simple
                  xml_parse_dom_large xml_parse_sax_large],
  html_parsing: %w[html_parse_simple html_parse_complex],
  xml_comparison: %w[xml_compare_identical xml_compare_similar
                     xml_compare_different],
  html_comparison: %w[html_compare_identical html_compare_similar
                      html_compare_different],
  formatting: %w[xml_c14n_format json_format yaml_format],
}.freeze

Instance Method Summary collapse

Instance Method Details

#runObject



25
26
27
28
29
30
# File 'lib/tasks/performance_comparator.rb', line 25

def run
  setup_environment
  run_benchmarks_comparison
ensure
  cleanup
end