Commit Graph

92 Commits

Author SHA1 Message Date
Sergii Tkachenko de6ed9ba9f
[Python] Migrate from yapf to black (#33138)
- Switched  from yapf to black
- Reconfigure isort for black
- Resolve black/pylint idiosyncrasies 

Note: I used `--experimental-string-processing` because black was
producing "implicit string concatenation", similar to what described
here: https://github.com/psf/black/issues/1837. While currently this
feature is experimental, it will be enabled by default:
https://github.com/psf/black/issues/2188. After running black with the
new string processing so that the generated code merges these `"hello" "
world"` strings concatenations, then I removed
`--experimental-string-processing` for stability, and regenerated the
code again.

To the reviewer: don't even try to open "Files Changed" tab 😄 It's
better to review commit-by-commit, and ignore `run black and isort`.
2023-06-09 15:08:55 -07:00
Craig Tiller 1f1f923a72
[benchmarks] Remove stats integration (#30900)
* remove old stats cruft

* remove

* remove

* fix

* fix
2022-09-09 04:15:12 -07:00
Jan Tattermusch eb79b6b178
More run_microbenchmark.py cleanup (#28893)
* cleanup

* update TODOs

* fixup
2022-02-17 19:14:08 +01:00
Jan Tattermusch d1db000f62
small cleanup in microbenchmark scripts (#28886) 2022-02-15 18:02:20 +01:00
AJ Heller 4ea47d6ae3
Fix python3 performance tests - incomplete migration from python2 (#25734)
This fixes a crash in the grpc_performance_profile_* and grpc_e2e_performance_* tests.

Example failure: https://source.cloud.google.com/results/invocations/2112f2d5-db91-4901-87cb-cc9865f351f1/targets

The daily performance test passes with this fixit branch:
http://sponge2/23d4df20-f4dd-48ee-8789-4cd96b078ed5.

Additional fixes:

reorder imports according to the google style guide
replace deprecated cgi.escape library method with html.escape
In case it comes up, with respect to upgrading from py2 to py3, the iter{items,keys,values} methods are intentionally replaced with the less-efficient-in-python2 non-iter versions. This is a recommended practice even when supporting both python versions, and this is not performance-critical code.

Additional note: there is no performance difference btw py2 and py3 (~80 minutes to finish)
2021-03-16 16:49:30 -07:00
AJ Heller 5139a012e7
Migrate the bm_diff benchmarks to python3 (#25619)
* Migrate the bm_diff benchmarks to python3

Includes a requirements.txt pinned at ~2017 versions, when this script
was first written.

* Replace p2 with p3 scipy/numpy dependencies.

* py2->3 for benchmark setup scripts

* upgrade pip to resolve python3 cryptography/setuptools-rust problem

* re-add jobset import (accidentally removed)

* re-add six's urllib import. This file is still used in py2 tests

* force py3 in run_if_c_cpp_modified.sh

* Fix another instance of subprocess.check_output binary mode

* Use the requirements.txt for CI perf environment setup

* Try to upgrade PyJWT. (v2.0.0 was problematic, #25053)

v2.x makes encode return strs from jwt.encode in both py2 and py3.
Previously, py3 would return bytes, and py2 a str.

* upgate cryptography lib version requirements for jwt.

* Wrap pip requirements specifier in quotes '>=x,<y'

* Decode subprocess output once instead of for every line

* Revert "Decode subprocess output once instead of for every line"

This reverts commit 28d14026431622ac7afd3535a8d7118e5be96628.

py2 doesn't support the `text` argument to subprocess.check_output.

* Address reviewer requests

* Pin a valid scipy version

* Remove scipy and tabulate dependencies from macos tests
2021-03-09 15:44:00 +01:00
Sergii Tkachenko 8db79e2e71 Python style: reformat code using updated yapf 0.30.0 2021-01-13 14:00:12 -05:00
Jan Tattermusch 648c38380b run_microbenchmark.py should use bazel 2020-08-19 10:18:04 -04:00
Esun Kim 7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
Esun Kim 90fbdc92f5 Roll-forward "Config migration"
This reverts commit 236ae12bb1.
2019-05-20 15:47:24 -07:00
Alexander Polcyn 236ae12bb1 Revert "Config migration"
This reverts commit 87905ae5ea.
2019-05-14 14:36:33 -07:00
Esun Kim 87905ae5ea Config migration 2019-05-09 12:29:38 -07:00
Mehrdad Afshari 87cd994b04 Upgrade yapf to 0.20.0
Upgrade yapf version to 0.20.0 and reformat Python files.
2018-01-02 14:40:00 -08:00
ncteisen 888093c6ed yapf run_tests 2017-12-11 18:08:35 -08:00
Noah Eisen 89563ca938 Add shortname and timeout to run_microbenchmarks 2017-08-28 17:37:43 -07:00
ncteisen 0ff7384f6d Merge branch 'master' of https://github.com/grpc/grpc into faster-bm-diff 2017-06-08 08:15:03 -07:00
Jan Tattermusch 7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
ncteisen 64637b7c8c restructure 2017-05-10 16:22:43 -07:00
Craig Tiller 06ac1c7086 Merge github.com:grpc/grpc into bmdiff2.1.1 2017-03-28 08:25:35 -07:00
Craig Tiller d23826e8b9 A more useful bm_diff? 2017-03-27 21:25:15 -07:00
Matt Kwong 504adae372 Add a TODO to enable microbenmarking for performance testing 2017-03-24 17:01:27 -07:00
Matt Kwong 063adf3fb4 Add additional benchmarks 2017-03-22 12:48:34 -07:00
Matt Kwong d0ee10df9b Change jenkins/run_performance.sh to use microbenchmarking 2017-03-22 12:44:50 -07:00
Matt Kwong aff1c05ed7 Make Jenkins post microbenchmarking diff in a comment 2017-03-16 17:04:33 -07:00
Siddharth Shukla 8e64d901fd Modify shebang on python scripts
Change shebangs to `#!/usr/bin/env python` instead of
`#!/usr/bin/env python2.7`.
2017-03-12 19:53:12 +01:00
Craig Tiller 47f37f3db3 Change execution order 2017-03-10 10:44:56 -08:00
Craig Tiller 5adc93e0ba Add more interesting metrics 2017-03-08 13:17:53 -08:00
Craig Tiller 26995eb2ee Get filename right 2017-03-08 13:10:28 -08:00
Craig Tiller b432885a56 Always write index.html 2017-03-08 13:08:40 -08:00
Craig Tiller f5362b1add Merge github.com:grpc/grpc into nudiff 2017-03-08 12:55:36 -08:00
Craig Tiller eb24a7bd84 Use new diff script 2017-03-07 17:04:46 -08:00
Craig Tiller 0dc57ad46f Move trickle to the end: it takes a while, and its less important (in the face of failures) 2017-03-03 13:15:13 -08:00
Craig Tiller 0d8b11fe21 Update test list 2017-03-03 11:10:09 -08:00
Craig Tiller 0a3d5f90a9 Revert "Enable lto for performance testing" 2017-03-01 17:08:39 -08:00
Craig Tiller 36281f950a Merge github.com:grpc/grpc into lto 2017-03-01 16:00:19 -08:00
Craig Tiller fbedd676f7 Merge pull request #9769 from ctiller/always-use-port-server
Always use port server
2017-03-01 15:11:37 -08:00
Craig Tiller 6d91f2d27b strip 2017-03-01 14:17:37 -08:00
Craig Tiller aa296fec74 Call the right function 2017-03-01 14:16:53 -08:00
Craig Tiller dce26f422c Make clean 2017-03-01 14:15:46 -08:00
Craig Tiller 5ef448d218 Fix module name :) 2017-03-01 14:12:47 -08:00
Craig Tiller ff84b3650f Experimental version 2017-03-01 14:11:15 -08:00
Craig Tiller 18a948ad2f Merge github.com:grpc/grpc into diff_perf 2017-03-01 14:00:51 -08:00
Craig Tiller d753f45cf3 Add argument 2017-03-01 14:00:35 -08:00
Craig Tiller f9abb2921b Reserve opt for external builds, use lto for profiling 2017-03-01 13:38:37 -08:00
Craig Tiller 541b87e015 Report non-counter cpu times to bigquery to get more accurate dashboards 2017-03-01 08:42:52 -08:00
Craig Tiller c2515d0c64 Merge github.com:grpc/grpc into always-use-port-server 2017-02-28 08:35:32 -08:00
Craig Tiller 312fdba350 Merge github.com:grpc/grpc into bm_meta 2017-02-24 17:03:20 -08:00
Craig Tiller 510f38a711 Merge branch 'bm_chttp2' into bm_meta 2017-02-24 17:00:19 -08:00
Craig Tiller 523d54beeb Refine to just be a HPACK benchmark 2017-02-23 08:52:38 -08:00
Craig Tiller 4d34729a4e Merge github.com:grpc/grpc into always-use-port-server 2017-02-23 06:57:05 -08:00