-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathairport_benchmarks.py
64 lines (45 loc) · 1.77 KB
/
airport_benchmarks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
Benchmark performance of airport reports.
"""
from report.airport import ReportContext
from report.pandas.airport import PandasAirportReports
from report.rxpy.airport import RxPyAirportReports
HOUSTON = (29.7604270, -95.3698030)
PANDAS_IMPL = PandasAirportReports()
RXPY_IMPL = RxPyAirportReports()
def test_pandas_airports_for_state(benchmark):
context = ReportContext()
context.state = 2008
benchmark(PANDAS_IMPL.report_airports_for_state, context)
def test_rxpy_airports_for_state(benchmark):
context = ReportContext()
context.state = 2008
benchmark(RXPY_IMPL.report_airports_for_state, context)
def test_pandas_airports_near_location(benchmark):
context = ReportContext()
context.location = HOUSTON
context.distance = 50
benchmark(PANDAS_IMPL.report_airports_near_location, context)
def test_rxpy_airports_near_location(benchmark):
context = ReportContext()
context.location = HOUSTON
context.distance = 50
benchmark(RXPY_IMPL.report_airports_near_location, context)
def test_pandas_airport_metrics(benchmark):
context = ReportContext()
context.year = 2008
benchmark(PANDAS_IMPL.report_airport_metrics, context)
def test_rxpy_airport_metrics(benchmark):
context = ReportContext()
context.year = 2008
benchmark(RXPY_IMPL.report_airport_metrics, context)
def test_pandas_airports_with_highest_cancellation_rate(benchmark):
context = ReportContext()
context.year = 2008
context.limit = 10
benchmark(PANDAS_IMPL.report_airports_with_highest_cancellation_rate, context)
def test_rxpy_airports_with_highest_cancellation_rate(benchmark):
context = ReportContext()
context.year = 2008
context.limit = 10
benchmark(RXPY_IMPL.report_airports_with_highest_cancellation_rate, context)