You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/04/27 16:08:24 UTC
[GitHub] [arrow-datafusion] alamb opened a new pull request, #6134: Improve `compare.py` output to use `min` times and better column titles
alamb opened a new pull request, #6134:
URL: https://github.com/apache/arrow-datafusion/pull/6134
# Which issue does this PR close?
Part of https://github.com/apache/arrow-datafusion/issues/6127
# Rationale for this change
I want to be able to easily understand what is being compared and reported. Currently the reporting from `compare.py` is somewhat opaque:
1. It averages benchmark run timings (which increases the variance)
2. The header columns are non sensical
# What changes are included in this PR?
1. Use `min` of the iteration times to report the benchmark results -- I think this minimizes run to run variance and is the fairest way to asses performance
2. Use the filename as the column header
# Are these changes tested?
No, it is a tool only change
# Are there any user-facing changes?
Not really
# Example output Before this PR
(note the bad headers)
```shell
python3 compare.py results/alamb_bench/tpch.json results/alamb_bench/tpch_mem.json
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query ┃ /Users/alam… ┃ -o ┃ Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1 │ 794.64ms │ 559.37ms │ +1.42x faster │
│ QQuery 2 │ 239.12ms │ 171.29ms │ +1.40x faster │
│ QQuery 3 │ 254.99ms │ 99.33ms │ +2.57x faster │
│ QQuery 4 │ 147.85ms │ 66.65ms │ +2.22x faster │
│ QQuery 5 │ 322.94ms │ 258.98ms │ +1.25x faster │
│ QQuery 6 │ 130.89ms │ 24.24ms │ +5.40x faster │
│ QQuery 7 │ 629.42ms │ 645.68ms │ no change │
│ QQuery 8 │ 375.57ms │ 140.26ms │ +2.68x faster │
│ QQuery 9 │ 597.65ms │ 334.59ms │ +1.79x faster │
│ QQuery 10 │ 397.16ms │ 197.59ms │ +2.01x faster │
│ QQuery 11 │ 182.41ms │ 167.33ms │ +1.09x faster │
│ QQuery 12 │ 228.44ms │ 99.10ms │ +2.31x faster │
│ QQuery 13 │ 736.21ms │ 438.47ms │ +1.68x faster │
│ QQuery 14 │ 195.68ms │ 31.99ms │ +6.12x faster │
│ QQuery 15 │ 175.08ms │ 57.62ms │ +3.04x faster │
│ QQuery 16 │ 175.67ms │ 144.90ms │ +1.21x faster │
│ QQuery 17 │ 1953.59ms │ 1925.39ms │ no change │
│ QQuery 18 │ 2133.06ms │ 1968.85ms │ +1.08x faster │
│ QQuery 19 │ 371.82ms │ 107.44ms │ +3.46x faster │
│ QQuery 20 │ 680.02ms │ 567.75ms │ +1.20x faster │
│ QQuery 21 │ 987.36ms │ 857.87ms │ +1.15x faster │
│ QQuery 22 │ 105.31ms │ 77.25ms │ +1.36x faster │
└──────────────┴──────────────┴──────────────┴───────────────┘
```
# Output after this PR
```bash
python3 compare.py results/alamb_bench/tpch.json results/alamb_bench/tpch_mem.json
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query ┃ tpch ┃ tpch_mem ┃ Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1 │ 762.35ms │ 548.16ms │ +1.39x faster │
│ QQuery 2 │ 210.23ms │ 164.26ms │ +1.28x faster │
│ QQuery 3 │ 239.37ms │ 96.47ms │ +2.48x faster │
│ QQuery 4 │ 147.01ms │ 59.81ms │ +2.46x faster │
│ QQuery 5 │ 317.68ms │ 251.01ms │ +1.27x faster │
│ QQuery 6 │ 129.40ms │ 22.86ms │ +5.66x faster │
│ QQuery 7 │ 603.09ms │ 629.24ms │ no change │
│ QQuery 8 │ 359.94ms │ 138.52ms │ +2.60x faster │
│ QQuery 9 │ 578.71ms │ 329.58ms │ +1.76x faster │
│ QQuery 10 │ 378.17ms │ 188.56ms │ +2.01x faster │
│ QQuery 11 │ 180.20ms │ 159.49ms │ +1.13x faster │
│ QQuery 12 │ 219.37ms │ 94.54ms │ +2.32x faster │
│ QQuery 13 │ 732.80ms │ 425.82ms │ +1.72x faster │
│ QQuery 14 │ 190.55ms │ 30.99ms │ +6.15x faster │
│ QQuery 15 │ 173.51ms │ 54.58ms │ +3.18x faster │
│ QQuery 16 │ 163.33ms │ 130.02ms │ +1.26x faster │
│ QQuery 17 │ 1866.25ms │ 1855.35ms │ no change │
│ QQuery 18 │ 2063.31ms │ 1916.26ms │ +1.08x faster │
│ QQuery 19 │ 363.00ms │ 102.86ms │ +3.53x faster │
│ QQuery 20 │ 639.92ms │ 530.65ms │ +1.21x faster │
│ QQuery 21 │ 946.66ms │ 815.83ms │ +1.16x faster │
│ QQuery 22 │ 103.37ms │ 73.07ms │ +1.41x faster │
└──────────────┴───────────┴───────────┴───────────────┘
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] comphead commented on a diff in pull request #6134: Improve `compare.py` output to use `min` times and better column titles
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #6134:
URL: https://github.com/apache/arrow-datafusion/pull/6134#discussion_r1180569668
##########
benchmarks/compare.py:
##########
@@ -64,14 +61,9 @@ def load_from(cls, data: Dict[str, Any]) -> QueryRun:
def execution_time(self) -> float:
assert len(self.iterations) >= 1
- # If we don't have enough samples, median() is probably
- # going to be a worse measure than just an average.
- if len(self.iterations) < MEAN_THRESHOLD:
- method = statistics.mean
- else:
- method = statistics.median
-
- return method(iteration.elapsed for iteration in self.iterations)
+ # Use minimum execution time to account for variations / other
+ # things the system was doing
+ return min(iteration.elapsed for iteration in self.iterations)
Review Comment:
lgtm, but imho, can `min` be deceptive comparing to `avg/mean/median`? 🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb merged pull request #6134: Improve `compare.py` output to use `min` times and better column titles
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6134:
URL: https://github.com/apache/arrow-datafusion/pull/6134
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb closed pull request #6134: Improve `compare.py` output to use `min` times and better column titles
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed pull request #6134: Improve `compare.py` output to use `min` times and better column titles
URL: https://github.com/apache/arrow-datafusion/pull/6134
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6134: Improve `compare.py` output to use `min` times and better column titles
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6134:
URL: https://github.com/apache/arrow-datafusion/pull/6134#discussion_r1180601182
##########
benchmarks/compare.py:
##########
@@ -64,14 +61,9 @@ def load_from(cls, data: Dict[str, Any]) -> QueryRun:
def execution_time(self) -> float:
assert len(self.iterations) >= 1
- # If we don't have enough samples, median() is probably
- # going to be a worse measure than just an average.
- if len(self.iterations) < MEAN_THRESHOLD:
- method = statistics.mean
- else:
- method = statistics.median
-
- return method(iteration.elapsed for iteration in self.iterations)
+ # Use minimum execution time to account for variations / other
+ # things the system was doing
+ return min(iteration.elapsed for iteration in self.iterations)
Review Comment:
I agree it is misleading -- in terms of measuring a change between datafusion versions, I think `min` will give us the least variance between runs and represents best case performance.
However, it doesn't really give a sense for how much variation is across runs 🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org