Skip to content

Commit febcc3e

Browse files
committed
[+] add cache_attribute_values benchmark
1 parent 66c099f commit febcc3e

4 files changed

Lines changed: 5 additions & 185 deletions

File tree

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ def compare_results(current_file, master_file)
190190
# Just run benchmark on master
191191
eval(BENCHMARK_SCRIPT)
192192
else
193+
# Get repository root
194+
repo_root = File.expand_path('..', __dir__)
195+
193196
# Create temp script
194197
temp_script = Tempfile.new(['benchmark', '.rb'])
195198
temp_script.write(BENCHMARK_SCRIPT)
@@ -200,15 +203,15 @@ def compare_results(current_file, master_file)
200203
current_output = Tempfile.new(['benchmark_current', '.txt'])
201204
current_output.close
202205

203-
system("cd #{__dir__} && ruby #{temp_script.path} > #{current_output.path} 2>&1", exception: true)
206+
system("cd #{repo_root} && ruby #{temp_script.path} > #{current_output.path} 2>&1", exception: true)
204207

205208
# Switch to master and run
206209
puts "\nSwitching to master branch..."
207210
master_output = Tempfile.new(['benchmark_master', '.txt'])
208211
master_output.close
209212

210213
system("git checkout master -q", exception: true)
211-
system("cd #{__dir__} && ruby #{temp_script.path} > #{master_output.path} 2>&1", exception: true)
214+
system("cd #{repo_root} && ruby #{temp_script.path} > #{master_output.path} 2>&1", exception: true)
212215

213216
# Switch back to original branch
214217
system("git checkout #{ORIGINAL_BRANCH} -q", exception: true)

perf/compare_branches.sh

Lines changed: 0 additions & 66 deletions
This file was deleted.

perf/results/current_branch.txt

Lines changed: 0 additions & 59 deletions
This file was deleted.

perf/results/master.txt

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)