Skip to content

diewland/py-rosetta2-vs-arm

Repository files navigation

Python Benchmark on M1 ( Rosetta2 vs ARM )

Preview Graph Interactive Graph

Spec

x86 on Rosetta2

Python 3.9.1 (default, Dec 28 2020, 11:25:16)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.uname()
uname_result(system='Darwin', node='diewbook.local', release='20.2.0', version='Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101', machine='x86_64')
>>> platform.uname()[4]
'x86_64'

ARM

Python 3.9.1 (default, Dec 28 2020, 06:19:44)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.uname()
uname_result(system='Darwin', node='diewbook.local', release='20.2.0', version='Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101', machine='arm64')
>>> platform.uname()[4]
'arm64'

Steps

https://pyperformance.readthedocs.io/usage.html#run-benchmarks

#1
/usr/local/bin/python3 -m venv vx86
source vx86/bin/activate
pip install --upgrade pip
pip install pyperformance
pyperformance run --python=python -o x86.json

#2 18:02,62% -> 18:19, 57%
python3 -m venv varm
source varm/bin/activate
pip install --upgrade pip
pip install pyperformance
pyperformance run --python=python -o arm.json

#3
pyperformance compare x86.json arm.json
pyperf compare_to x86.json arm.json --table > out

PS. unplug benchmarks

Output

+-------------------------+---------+------------------------------+
| Benchmark               | x86     | arm                          |
+=========================+=========+==============================+
| 2to3                    | 366 ms  | 246 ms: 1.49x faster (-33%)  |
+-------------------------+---------+------------------------------+
| chameleon               | 12.4 ms | 8.25 ms: 1.50x faster (-34%) |
+-------------------------+---------+------------------------------+
| chaos                   | 143 ms  | 96.1 ms: 1.49x faster (-33%) |
+-------------------------+---------+------------------------------+
| crypto_pyaes            | 152 ms  | 103 ms: 1.48x faster (-33%)  |
+-------------------------+---------+------------------------------+
| deltablue               | 9.23 ms | 6.36 ms: 1.45x faster (-31%) |
+-------------------------+---------+------------------------------+
| django_template         | 59.1 ms | 38.9 ms: 1.52x faster (-34%) |
+-------------------------+---------+------------------------------+
| dulwich_log             | 58.2 ms | 38.2 ms: 1.52x faster (-34%) |
+-------------------------+---------+------------------------------+
| fannkuch                | 620 ms  | 400 ms: 1.55x faster (-35%)  |
+-------------------------+---------+------------------------------+
| float                   | 158 ms  | 97.4 ms: 1.62x faster (-38%) |
+-------------------------+---------+------------------------------+
| genshi_text             | 34.8 ms | 22.6 ms: 1.54x faster (-35%) |
+-------------------------+---------+------------------------------+
| genshi_xml              | 73.8 ms | 46.0 ms: 1.60x faster (-38%) |
+-------------------------+---------+------------------------------+
| go                      | 306 ms  | 214 ms: 1.43x faster (-30%)  |
+-------------------------+---------+------------------------------+
| hexiom                  | 12.7 ms | 8.21 ms: 1.55x faster (-36%) |
+-------------------------+---------+------------------------------+
| json_dumps              | 15.1 ms | 11.0 ms: 1.37x faster (-27%) |
+-------------------------+---------+------------------------------+
| json_loads              | 32.5 us | 25.1 us: 1.30x faster (-23%) |
+-------------------------+---------+------------------------------+
| logging_format          | 10.0 us | 6.64 us: 1.51x faster (-34%) |
+-------------------------+---------+------------------------------+
| logging_silent          | 243 ns  | 170 ns: 1.43x faster (-30%)  |
+-------------------------+---------+------------------------------+
| logging_simple          | 9.43 us | 6.12 us: 1.54x faster (-35%) |
+-------------------------+---------+------------------------------+
| mako                    | 20.2 ms | 13.8 ms: 1.47x faster (-32%) |
+-------------------------+---------+------------------------------+
| meteor_contest          | 127 ms  | 88.5 ms: 1.44x faster (-31%) |
+-------------------------+---------+------------------------------+
| nbody                   | 209 ms  | 127 ms: 1.64x faster (-39%)  |
+-------------------------+---------+------------------------------+
| nqueens                 | 125 ms  | 83.9 ms: 1.49x faster (-33%) |
+-------------------------+---------+------------------------------+
| pathlib                 | 30.7 ms | 22.8 ms: 1.34x faster (-26%) |
+-------------------------+---------+------------------------------+
| pickle                  | 13.6 us | 11.3 us: 1.20x faster (-17%) |
+-------------------------+---------+------------------------------+
| pickle_dict             | 29.1 us | 26.3 us: 1.11x faster (-10%) |
+-------------------------+---------+------------------------------+
| pickle_list             | 4.66 us | 4.10 us: 1.14x faster (-12%) |
+-------------------------+---------+------------------------------+
| pickle_pure_python      | 587 us  | 390 us: 1.51x faster (-34%)  |
+-------------------------+---------+------------------------------+
| pidigits                | 269 ms  | 282 ms: 1.05x slower (+5%)   |
+-------------------------+---------+------------------------------+
| pyflate                 | 908 ms  | 578 ms: 1.57x faster (-36%)  |
+-------------------------+---------+------------------------------+
| python_startup          | 24.4 ms | 8.69 ms: 2.81x faster (-64%) |
+-------------------------+---------+------------------------------+
| python_startup_no_site  | 20.4 ms | 6.50 ms: 3.14x faster (-68%) |
+-------------------------+---------+------------------------------+
| raytrace                | 664 ms  | 444 ms: 1.49x faster (-33%)  |
+-------------------------+---------+------------------------------+
| regex_compile           | 189 ms  | 128 ms: 1.48x faster (-32%)  |
+-------------------------+---------+------------------------------+
| regex_dna               | 235 ms  | 171 ms: 1.37x faster (-27%)  |
+-------------------------+---------+------------------------------+
| regex_effbot            | 4.24 ms | 2.64 ms: 1.61x faster (-38%) |
+-------------------------+---------+------------------------------+
| regex_v8                | 32.6 ms | 21.4 ms: 1.52x faster (-34%) |
+-------------------------+---------+------------------------------+
| richards                | 94.7 ms | 63.4 ms: 1.49x faster (-33%) |
+-------------------------+---------+------------------------------+
| scimark_fft             | 515 ms  | 319 ms: 1.61x faster (-38%)  |
+-------------------------+---------+------------------------------+
| scimark_lu              | 213 ms  | 139 ms: 1.53x faster (-35%)  |
+-------------------------+---------+------------------------------+
| scimark_monte_carlo     | 138 ms  | 93.0 ms: 1.49x faster (-33%) |
+-------------------------+---------+------------------------------+
| scimark_sor             | 270 ms  | 179 ms: 1.51x faster (-34%)  |
+-------------------------+---------+------------------------------+
| scimark_sparse_mat_mult | 7.47 ms | 4.53 ms: 1.65x faster (-39%) |
+-------------------------+---------+------------------------------+
| spectral_norm           | 204 ms  | 134 ms: 1.52x faster (-34%)  |
+-------------------------+---------+------------------------------+
| sqlalchemy_declarative  | 145 ms  | 98.3 ms: 1.48x faster (-32%) |
+-------------------------+---------+------------------------------+
| sqlalchemy_imperative   | 21.5 ms | 14.5 ms: 1.49x faster (-33%) |
+-------------------------+---------+------------------------------+
| sqlite_synth            | 4.10 us | 1.99 us: 2.06x faster (-51%) |
+-------------------------+---------+------------------------------+
| sympy_expand            | 504 ms  | 340 ms: 1.48x faster (-33%)  |
+-------------------------+---------+------------------------------+
| sympy_integrate         | 24.8 ms | 17.1 ms: 1.45x faster (-31%) |
+-------------------------+---------+------------------------------+
| sympy_sum               | 194 ms  | 134 ms: 1.45x faster (-31%)  |
+-------------------------+---------+------------------------------+
| sympy_str               | 321 ms  | 220 ms: 1.46x faster (-31%)  |
+-------------------------+---------+------------------------------+
| telco                   | 7.70 ms | 4.84 ms: 1.59x faster (-37%) |
+-------------------------+---------+------------------------------+
| unpack_sequence         | 67.9 ns | 42.8 ns: 1.58x faster (-37%) |
+-------------------------+---------+------------------------------+
| unpickle                | 19.5 us | 13.3 us: 1.47x faster (-32%) |
+-------------------------+---------+------------------------------+
| unpickle_list           | 5.87 us | 3.86 us: 1.52x faster (-34%) |
+-------------------------+---------+------------------------------+
| unpickle_pure_python    | 458 us  | 280 us: 1.64x faster (-39%)  |
+-------------------------+---------+------------------------------+
| xml_etree_parse         | 216 ms  | 135 ms: 1.61x faster (-38%)  |
+-------------------------+---------+------------------------------+
| xml_etree_iterparse     | 135 ms  | 91.2 ms: 1.48x faster (-32%) |
+-------------------------+---------+------------------------------+
| xml_etree_generate      | 112 ms  | 74.5 ms: 1.50x faster (-33%) |
+-------------------------+---------+------------------------------+
| xml_etree_process       | 94.5 ms | 59.5 ms: 1.59x faster (-37%) |
+-------------------------+---------+------------------------------+

Not significant (1): tornado_http

Releases

No releases published

Packages

No packages published