{"action":"created","comment":{"url":"https://api.github.com/repos/python-hyper/hyperframe/pulls/comments/83212442","pull_request_review_id":4068991,"id":83212442,"diff_hunk":"@@ -0,0 +1,52 @@\n+from bench.utils.factories import FRAME_FACTORIES\n+from bench.utils import get_int\n+\n+\n+NUMBER_OF_FRAMES = 100\n+\n+\n+def _serialize_function(frames):\n+    frame = frames[get_int(0, NUMBER_OF_FRAMES - 1)]\n+    frame.serialize()\n+\n+\n+def _create_frames(frame_type):\n+    return [FRAME_FACTORIES[frame_type]() for _ in range(100)]\n+\n+\n+class TestSerializeBenchmarks:\n+    def test_serialize_data_frame(self, benchmark):\n+        benchmark(_serialize_function, _create_frames(\"data\"))","path":"bench/test_serialize.py","position":19,"original_position":19,"commit_id":"f60f19d1d3881b84eae65aa7676e263e9e87b4ee","original_commit_id":"f60f19d1d3881b84eae65aa7676e263e9e87b4ee","user":{"login":"alexwlchan","id":301220,"avatar_url":"https://avatars.githubusercontent.com/u/301220?v=3","gravatar_id":"","url":"https://api.github.com/users/alexwlchan","html_url":"https://github.com/alexwlchan","followers_url":"https://api.github.com/users/alexwlchan/followers","following_url":"https://api.github.com/users/alexwlchan/following{/other_user}","gists_url":"https://api.github.com/users/alexwlchan/gists{/gist_id}","starred_url":"https://api.github.com/users/alexwlchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexwlchan/subscriptions","organizations_url":"https://api.github.com/users/alexwlchan/orgs","repos_url":"https://api.github.com/users/alexwlchan/repos","events_url":"https://api.github.com/users/alexwlchan/events{/privacy}","received_events_url":"https://api.github.com/users/alexwlchan/received_events","type":"User","site_admin":false},"body":"Given that pytest is already in use elsewhere in the codebase, I wonder if it would be worth condensing this using `@pytest.mark.parametrize`, something like:\r\n\r\n```python\r\n@pytest.mark.parametrize('frame_name', [\r\n    'data',\r\n    'priority',\r\n    ...,\r\n    'rst_stream'\r\n])\r\ndef test_serialize_frame(frame_name, benchmark):\r\n    benchmark(_serialize_function, _create_frames(frame_name))\r\n```","created_at":"2016-10-13T13:16:04Z","updated_at":"2016-10-13T13:16:04Z","html_url":"https://github.com/python-hyper/hyperframe/pull/64#discussion_r83212442","pull_request_url":"https://api.github.com/repos/python-hyper/hyperframe/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/python-hyper/hyperframe/pulls/comments/83212442"},"html":{"href":"https://github.com/python-hyper/hyperframe/pull/64#discussion_r83212442"},"pull_request":{"href":"https://api.github.com/repos/python-hyper/hyperframe/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/python-hyper/hyperframe/pulls/64","id":87382279,"html_url":"https://github.com/python-hyper/hyperframe/pull/64","diff_url":"https://github.com/python-hyper/hyperframe/pull/64.diff","patch_url":"https://github.com/python-hyper/hyperframe/pull/64.patch","issue_url":"https://api.github.com/repos/python-hyper/hyperframe/issues/64","number":64,"state":"open","locked":false,"title":"Benchmarking Tools","user":{"login":"SethMichaelLarson","id":18519037,"avatar_url":"https://avatars.githubusercontent.com/u/18519037?v=3","gravatar_id":"","url":"https://api.github.com/users/SethMichaelLarson","html_url":"https://github.com/SethMichaelLarson","followers_url":"https://api.github.com/users/SethMichaelLarson/followers","following_url":"https://api.github.com/users/SethMichaelLarson/following{/other_user}","gists_url":"https://api.github.com/users/SethMichaelLarson/gists{/gist_id}","starred_url":"https://api.github.com/users/SethMichaelLarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SethMichaelLarson/subscriptions","organizations_url":"https://api.github.com/users/SethMichaelLarson/orgs","repos_url":"https://api.github.com/users/SethMichaelLarson/repos","events_url":"https://api.github.com/users/SethMichaelLarson/events{/privacy}","received_events_url":"https://api.github.com/users/SethMichaelLarson/received_events","type":"User","site_admin":false},"body":"Hello, I am opening this PR with the intent of not merging this work immediately, but rather to get feedback on how benchmarking of hyperframe, hpack, etc should be structured or put. If another repository is best then I will move all code there.\r\n\r\nThis current benchmarking tool is run using `make bench` or `python setup.py bench`.  It runs all the classes that match the name `^[^_].*Benchmark$` in any modules in the `bench/` directory.  The current output format is only graphical, in the future the output will be in a data format allowing an easy comparison between two different runs of the benchmarks.\r\n\r\n@Lukasa spoke about the possibility of this being automated in some way to keep our benchmarks up to date and to make it easier to make decisions regarding performance related improvements.\r\n\r\nThe output of a single benchmark run currently looks like this:\r\n\r\n```\r\nBenchmarking System: Linux x86_64\r\nBenchmarking Python: CPython 3.5.2\r\n\r\nCollected 21 benchmarks to run\r\n\r\n_warmup .................................................. 446.13 ms +/- 5.73 ms\r\nparse_data_frame ...................................... 9822.99 ms +/- 175.33 ms\r\nparse_go_away_frame .................................... 5481.53 ms +/- 80.66 ms\r\nparse_headers_frame .................................. 12555.85 ms +/- 283.92 ms\r\nparse_ping_frame ...................................... 5771.38 ms +/- 157.89 ms\r\nparse_priority_frame .................................... 5170.87 ms +/- 4.67 ms\r\nparse_push_promise_frame ............................... 10002.43 ms +/- 7.08 ms\r\nparse_rst_stream_frame ................................. 4589.44 ms +/- 10.84 ms\r\nparse_settings_ack_frame .............................. 5929.48 ms +/- 124.71 ms\r\nparse_settings_frame .................................. 8389.81 ms +/- 197.46 ms\r\nparse_window_update_frame .............................. 4579.93 ms +/- 52.16 ms\r\nserialize_data_frame ................................. 13381.87 ms +/- 191.30 ms\r\nserialize_go_away_frame ................................ 2976.84 ms +/- 85.71 ms\r\nserialize_headers_frame .............................. 15464.16 ms +/- 191.70 ms\r\nserialize_ping_frame ................................... 3980.39 ms +/- 90.43 ms\r\nserialize_priority_frame ................................ 2789.14 ms +/- 1.77 ms\r\nserialize_push_promise_frame ......................... 12599.25 ms +/- 187.90 ms\r\nserialize_rst_stream_frame ............................. 2451.56 ms +/- 12.40 ms\r\nserialize_settings_ack_frame .......................... 4242.05 ms +/- 100.14 ms\r\nserialize_settings_frame .............................. 7848.12 ms +/- 223.89 ms\r\nserialize_window_update_frame .......................... 2698.77 ms +/- 80.20 ms\r\n```\r\n\r\nConstructive criticism is very much welcomed!","created_at":"2016-09-29T19:56:08Z","updated_at":"2016-10-13T13:16:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66e26b8c44fc114c16932937609f040d947529db","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/python-hyper/hyperframe/pulls/64/commits","review_comments_url":"https://api.github.com/repos/python-hyper/hyperframe/pulls/64/comments","review_comment_url":"https://api.github.com/repos/python-hyper/hyperframe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python-hyper/hyperframe/issues/64/comments","statuses_url":"https://api.github.com/repos/python-hyper/hyperframe/statuses/f60f19d1d3881b84eae65aa7676e263e9e87b4ee","head":{"label":"SethMichaelLarson:master","ref":"master","sha":"f60f19d1d3881b84eae65aa7676e263e9e87b4ee","user":{"login":"SethMichaelLarson","id":18519037,"avatar_url":"https://avatars.githubusercontent.com/u/18519037?v=3","gravatar_id":"","url":"https://api.github.com/users/SethMichaelLarson","html_url":"https://github.com/SethMichaelLarson","followers_url":"https://api.github.com/users/SethMichaelLarson/followers","following_url":"https://api.github.com/users/SethMichaelLarson/following{/other_user}","gists_url":"https://api.github.com/users/SethMichaelLarson/gists{/gist_id}","starred_url":"https://api.github.com/users/SethMichaelLarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SethMichaelLarson/subscriptions","organizations_url":"https://api.github.com/users/SethMichaelLarson/orgs","repos_url":"https://api.github.com/users/SethMichaelLarson/repos","events_url":"https://api.github.com/users/SethMichaelLarson/events{/privacy}","received_events_url":"https://api.github.com/users/SethMichaelLarson/received_events","type":"User","site_admin":false},"repo":{"id":69493688,"name":"hyperframe","full_name":"SethMichaelLarson/hyperframe","owner":{"login":"SethMichaelLarson","id":18519037,"avatar_url":"https://avatars.githubusercontent.com/u/18519037?v=3","gravatar_id":"","url":"https://api.github.com/users/SethMichaelLarson","html_url":"https://github.com/SethMichaelLarson","followers_url":"https://api.github.com/users/SethMichaelLarson/followers","following_url":"https://api.github.com/users/SethMichaelLarson/following{/other_user}","gists_url":"https://api.github.com/users/SethMichaelLarson/gists{/gist_id}","starred_url":"https://api.github.com/users/SethMichaelLarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SethMichaelLarson/subscriptions","organizations_url":"https://api.github.com/users/SethMichaelLarson/orgs","repos_url":"https://api.github.com/users/SethMichaelLarson/repos","events_url":"https://api.github.com/users/SethMichaelLarson/events{/privacy}","received_events_url":"https://api.github.com/users/SethMichaelLarson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SethMichaelLarson/hyperframe","description":"Pure-Python HTTP/2 framing","fork":true,"url":"https://api.github.com/repos/SethMichaelLarson/hyperframe","forks_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/forks","keys_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/teams","hooks_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/hooks","issue_events_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/issues/events{/number}","events_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/events","assignees_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/assignees{/user}","branches_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/branches{/branch}","tags_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/tags","blobs_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/git/refs{/sha}","trees_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/statuses/{sha}","languages_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/languages","stargazers_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/stargazers","contributors_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/contributors","subscribers_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/subscribers","subscription_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/subscription","commits_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/commits{/sha}","git_commits_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/git/commits{/sha}","comments_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/comments{/number}","issue_comment_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/issues/comments{/number}","contents_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/contents/{+path}","compare_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/merges","archive_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/downloads","issues_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/issues{/number}","pulls_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/pulls{/number}","milestones_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/milestones{/number}","notifications_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/labels{/name}","releases_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/releases{/id}","deployments_url":"https://api.github.com/repos/SethMichaelLarson/hyperframe/deployments","created_at":"2016-09-28T18:51:01Z","updated_at":"2016-09-28T18:51:03Z","pushed_at":"2016-10-11T20:20:34Z","git_url":"git://github.com/SethMichaelLarson/hyperframe.git","ssh_url":"git@github.com:SethMichaelLarson/hyperframe.git","clone_url":"https://github.com/SethMichaelLarson/hyperframe.git","svn_url":"https://github.com/SethMichaelLarson/hyperframe","homepage":"http://python-hyper.org/hyperframe/","size":149,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"python-hyper:master","ref":"master","sha":"f0c1e9214c994ff7b5c8ac7677947931c53a1307","user":{"login":"python-hyper","id":13035907,"avatar_url":"https://avatars.githubusercontent.com/u/13035907?v=3","gravatar_id":"","url":"https://api.github.com/users/python-hyper","html_url":"https://github.com/python-hyper","followers_url":"https://api.github.com/users/python-hyper/followers","following_url":"https://api.github.com/users/python-hyper/following{/other_user}","gists_url":"https://api.github.com/users/python-hyper/gists{/gist_id}","starred_url":"https://api.github.com/users/python-hyper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-hyper/subscriptions","organizations_url":"https://api.github.com/users/python-hyper/orgs","repos_url":"https://api.github.com/users/python-hyper/repos","events_url":"https://api.github.com/users/python-hyper/events{/privacy}","received_events_url":"https://api.github.com/users/python-hyper/received_events","type":"Organization","site_admin":false},"repo":{"id":33842039,"name":"hyperframe","full_name":"python-hyper/hyperframe","owner":{"login":"python-hyper","id":13035907,"avatar_url":"https://avatars.githubusercontent.com/u/13035907?v=3","gravatar_id":"","url":"https://api.github.com/users/python-hyper","html_url":"https://github.com/python-hyper","followers_url":"https://api.github.com/users/python-hyper/followers","following_url":"https://api.github.com/users/python-hyper/following{/other_user}","gists_url":"https://api.github.com/users/python-hyper/gists{/gist_id}","starred_url":"https://api.github.com/users/python-hyper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-hyper/subscriptions","organizations_url":"https://api.github.com/users/python-hyper/orgs","repos_url":"https://api.github.com/users/python-hyper/repos","events_url":"https://api.github.com/users/python-hyper/events{/privacy}","received_events_url":"https://api.github.com/users/python-hyper/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python-hyper/hyperframe","description":"Pure-Python HTTP/2 framing","fork":false,"url":"https://api.github.com/repos/python-hyper/hyperframe","forks_url":"https://api.github.com/repos/python-hyper/hyperframe/forks","keys_url":"https://api.github.com/repos/python-hyper/hyperframe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-hyper/hyperframe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-hyper/hyperframe/teams","hooks_url":"https://api.github.com/repos/python-hyper/hyperframe/hooks","issue_events_url":"https://api.github.com/repos/python-hyper/hyperframe/issues/events{/number}","events_url":"https://api.github.com/repos/python-hyper/hyperframe/events","assignees_url":"https://api.github.com/repos/python-hyper/hyperframe/assignees{/user}","branches_url":"https://api.github.com/repos/python-hyper/hyperframe/branches{/branch}","tags_url":"https://api.github.com/repos/python-hyper/hyperframe/tags","blobs_url":"https://api.github.com/repos/python-hyper/hyperframe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-hyper/hyperframe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-hyper/hyperframe/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-hyper/hyperframe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-hyper/hyperframe/statuses/{sha}","languages_url":"https://api.github.com/repos/python-hyper/hyperframe/languages","stargazers_url":"https://api.github.com/repos/python-hyper/hyperframe/stargazers","contributors_url":"https://api.github.com/repos/python-hyper/hyperframe/contributors","subscribers_url":"https://api.github.com/repos/python-hyper/hyperframe/subscribers","subscription_url":"https://api.github.com/repos/python-hyper/hyperframe/subscription","commits_url":"https://api.github.com/repos/python-hyper/hyperframe/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-hyper/hyperframe/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-hyper/hyperframe/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-hyper/hyperframe/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-hyper/hyperframe/contents/{+path}","compare_url":"https://api.github.com/repos/python-hyper/hyperframe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-hyper/hyperframe/merges","archive_url":"https://api.github.com/repos/python-hyper/hyperframe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-hyper/hyperframe/downloads","issues_url":"https://api.github.com/repos/python-hyper/hyperframe/issues{/number}","pulls_url":"https://api.github.com/repos/python-hyper/hyperframe/pulls{/number}","milestones_url":"https://api.github.com/repos/python-hyper/hyperframe/milestones{/number}","notifications_url":"https://api.github.com/repos/python-hyper/hyperframe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-hyper/hyperframe/labels{/name}","releases_url":"https://api.github.com/repos/python-hyper/hyperframe/releases{/id}","deployments_url":"https://api.github.com/repos/python-hyper/hyperframe/deployments","created_at":"2015-04-13T01:43:13Z","updated_at":"2016-09-29T12:59:36Z","pushed_at":"2016-10-12T11:11:54Z","git_url":"git://github.com/python-hyper/hyperframe.git","ssh_url":"git@github.com:python-hyper/hyperframe.git","clone_url":"https://github.com/python-hyper/hyperframe.git","svn_url":"https://github.com/python-hyper/hyperframe","homepage":"http://python-hyper.org/hyperframe/","size":151,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python-hyper/hyperframe/pulls/64"},"html":{"href":"https://github.com/python-hyper/hyperframe/pull/64"},"issue":{"href":"https://api.github.com/repos/python-hyper/hyperframe/issues/64"},"comments":{"href":"https://api.github.com/repos/python-hyper/hyperframe/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/python-hyper/hyperframe/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/python-hyper/hyperframe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python-hyper/hyperframe/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/python-hyper/hyperframe/statuses/f60f19d1d3881b84eae65aa7676e263e9e87b4ee"}}}}
{"actor":{"display_login":"alexwlchan"}}