{"action":"closed","number":538,"pull_request":{"url":"https://api.github.com/repos/plack/Plack/pulls/538","id":50777696,"html_url":"https://github.com/plack/Plack/pull/538","diff_url":"https://github.com/plack/Plack/pull/538.diff","patch_url":"https://github.com/plack/Plack/pull/538.patch","issue_url":"https://api.github.com/repos/plack/Plack/issues/538","number":538,"state":"closed","locked":false,"title":"replace HTTP::Body with HTTP::Entity::Parser and optimize query_parameters","user":{"login":"kazeburo","id":46764,"avatar_url":"https://avatars.githubusercontent.com/u/46764?v=3","gravatar_id":"","url":"https://api.github.com/users/kazeburo","html_url":"https://github.com/kazeburo","followers_url":"https://api.github.com/users/kazeburo/followers","following_url":"https://api.github.com/users/kazeburo/following{/other_user}","gists_url":"https://api.github.com/users/kazeburo/gists{/gist_id}","starred_url":"https://api.github.com/users/kazeburo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazeburo/subscriptions","organizations_url":"https://api.github.com/users/kazeburo/orgs","repos_url":"https://api.github.com/users/kazeburo/repos","events_url":"https://api.github.com/users/kazeburo/events{/privacy}","received_events_url":"https://api.github.com/users/kazeburo/received_events","type":"User","site_admin":false},"body":"related to #537 and #434\r\n\r\nThis PR replace HTTP::Body with HTTP::Entity::Parser and WWW::Form::UrlEncoded(::XS). HTTP::Entity::Parser was created based on tokuhirom's code of #434.\r\n\r\nAnd also this PR remove `Hash::MultiValue->flatten` in `parameters` for reducing cost.\r\n\r\nHere is small benchmark this pr and master.\r\n\r\nuse HTTP::Entity::Parser and WWW::Form::UrlEncoded::XS\r\n\r\n```\r\n% perl -Ilib entity_parser_bench.pl\r\nBenchmark: running get, noparam, post for at least 3 CPU seconds...\r\n       get:  3 wallclock secs ( 3.11 usr +  0.00 sys =  3.11 CPU) @ 6381.03/s (n=19845)\r\n   noparam:  3 wallclock secs ( 3.09 usr +  0.00 sys =  3.09 CPU) @ 7336.57/s (n=22670)\r\n      post:  3 wallclock secs ( 3.30 usr +  0.00 sys =  3.30 CPU) @ 5225.15/s (n=17243)\r\n          Rate    post     get noparam\r\npost    5225/s      --    -18%    -29%\r\nget     6381/s     22%      --    -13%\r\nnoparam 7337/s     40%     15%      --\r\n```\r\n\r\nmaster(0fbe07327b6caacdeb798ce06c3236f3af3178a2)\r\n\r\n```\r\n% perl -Ilib entity_parser_bench.pl\r\nBenchmark: running get, noparam, post for at least 3 CPU seconds...\r\n       get:  3 wallclock secs ( 3.03 usr +  0.00 sys =  3.03 CPU) @ 4884.49/s (n=14800)\r\n   noparam:  3 wallclock secs ( 3.34 usr +  0.00 sys =  3.34 CPU) @ 6130.24/s (n=20475)\r\n      post:  3 wallclock secs ( 3.05 usr +  0.00 sys =  3.05 CPU) @ 3472.79/s (n=10592)\r\n          Rate    post     get noparam\r\npost    3473/s      --    -29%    -43%\r\nget     4884/s     41%      --    -20%\r\nnoparam 6130/s     77%     26%      --\r\n```\r\n\r\n","created_at":"2015-11-16T07:10:30Z","updated_at":"2015-11-18T06:52:06Z","closed_at":"2015-11-18T06:52:06Z","merged_at":null,"merge_commit_sha":"54871dc1a4b3097befbcd072fb9dd3ae5bd7f89a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/plack/Plack/pulls/538/commits","review_comments_url":"https://api.github.com/repos/plack/Plack/pulls/538/comments","review_comment_url":"https://api.github.com/repos/plack/Plack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plack/Plack/issues/538/comments","statuses_url":"https://api.github.com/repos/plack/Plack/statuses/f4db58113a54591405102fead4cf435425bc1343","head":{"label":"kazeburo:use-http-entity-parser","ref":"use-http-entity-parser","sha":"f4db58113a54591405102fead4cf435425bc1343","user":{"login":"kazeburo","id":46764,"avatar_url":"https://avatars.githubusercontent.com/u/46764?v=3","gravatar_id":"","url":"https://api.github.com/users/kazeburo","html_url":"https://github.com/kazeburo","followers_url":"https://api.github.com/users/kazeburo/followers","following_url":"https://api.github.com/users/kazeburo/following{/other_user}","gists_url":"https://api.github.com/users/kazeburo/gists{/gist_id}","starred_url":"https://api.github.com/users/kazeburo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazeburo/subscriptions","organizations_url":"https://api.github.com/users/kazeburo/orgs","repos_url":"https://api.github.com/users/kazeburo/repos","events_url":"https://api.github.com/users/kazeburo/events{/privacy}","received_events_url":"https://api.github.com/users/kazeburo/received_events","type":"User","site_admin":false},"repo":{"id":9189148,"name":"Plack","full_name":"kazeburo/Plack","owner":{"login":"kazeburo","id":46764,"avatar_url":"https://avatars.githubusercontent.com/u/46764?v=3","gravatar_id":"","url":"https://api.github.com/users/kazeburo","html_url":"https://github.com/kazeburo","followers_url":"https://api.github.com/users/kazeburo/followers","following_url":"https://api.github.com/users/kazeburo/following{/other_user}","gists_url":"https://api.github.com/users/kazeburo/gists{/gist_id}","starred_url":"https://api.github.com/users/kazeburo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazeburo/subscriptions","organizations_url":"https://api.github.com/users/kazeburo/orgs","repos_url":"https://api.github.com/users/kazeburo/repos","events_url":"https://api.github.com/users/kazeburo/events{/privacy}","received_events_url":"https://api.github.com/users/kazeburo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kazeburo/Plack","description":"PSGI toolkit and server adapters","fork":true,"url":"https://api.github.com/repos/kazeburo/Plack","forks_url":"https://api.github.com/repos/kazeburo/Plack/forks","keys_url":"https://api.github.com/repos/kazeburo/Plack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kazeburo/Plack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kazeburo/Plack/teams","hooks_url":"https://api.github.com/repos/kazeburo/Plack/hooks","issue_events_url":"https://api.github.com/repos/kazeburo/Plack/issues/events{/number}","events_url":"https://api.github.com/repos/kazeburo/Plack/events","assignees_url":"https://api.github.com/repos/kazeburo/Plack/assignees{/user}","branches_url":"https://api.github.com/repos/kazeburo/Plack/branches{/branch}","tags_url":"https://api.github.com/repos/kazeburo/Plack/tags","blobs_url":"https://api.github.com/repos/kazeburo/Plack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kazeburo/Plack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kazeburo/Plack/git/refs{/sha}","trees_url":"https://api.github.com/repos/kazeburo/Plack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kazeburo/Plack/statuses/{sha}","languages_url":"https://api.github.com/repos/kazeburo/Plack/languages","stargazers_url":"https://api.github.com/repos/kazeburo/Plack/stargazers","contributors_url":"https://api.github.com/repos/kazeburo/Plack/contributors","subscribers_url":"https://api.github.com/repos/kazeburo/Plack/subscribers","subscription_url":"https://api.github.com/repos/kazeburo/Plack/subscription","commits_url":"https://api.github.com/repos/kazeburo/Plack/commits{/sha}","git_commits_url":"https://api.github.com/repos/kazeburo/Plack/git/commits{/sha}","comments_url":"https://api.github.com/repos/kazeburo/Plack/comments{/number}","issue_comment_url":"https://api.github.com/repos/kazeburo/Plack/issues/comments{/number}","contents_url":"https://api.github.com/repos/kazeburo/Plack/contents/{+path}","compare_url":"https://api.github.com/repos/kazeburo/Plack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kazeburo/Plack/merges","archive_url":"https://api.github.com/repos/kazeburo/Plack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kazeburo/Plack/downloads","issues_url":"https://api.github.com/repos/kazeburo/Plack/issues{/number}","pulls_url":"https://api.github.com/repos/kazeburo/Plack/pulls{/number}","milestones_url":"https://api.github.com/repos/kazeburo/Plack/milestones{/number}","notifications_url":"https://api.github.com/repos/kazeburo/Plack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kazeburo/Plack/labels{/name}","releases_url":"https://api.github.com/repos/kazeburo/Plack/releases{/id}","created_at":"2013-04-03T07:30:12Z","updated_at":"2014-09-09T09:39:32Z","pushed_at":"2015-11-18T05:49:58Z","git_url":"git://github.com/kazeburo/Plack.git","ssh_url":"git@github.com:kazeburo/Plack.git","clone_url":"https://github.com/kazeburo/Plack.git","svn_url":"https://github.com/kazeburo/Plack","homepage":"http://plackperl.org/","size":6012,"stargazers_count":0,"watchers_count":0,"language":"Perl","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":"plack:master","ref":"master","sha":"0fbe07327b6caacdeb798ce06c3236f3af3178a2","user":{"login":"plack","id":1691275,"avatar_url":"https://avatars.githubusercontent.com/u/1691275?v=3","gravatar_id":"","url":"https://api.github.com/users/plack","html_url":"https://github.com/plack","followers_url":"https://api.github.com/users/plack/followers","following_url":"https://api.github.com/users/plack/following{/other_user}","gists_url":"https://api.github.com/users/plack/gists{/gist_id}","starred_url":"https://api.github.com/users/plack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plack/subscriptions","organizations_url":"https://api.github.com/users/plack/orgs","repos_url":"https://api.github.com/users/plack/repos","events_url":"https://api.github.com/users/plack/events{/privacy}","received_events_url":"https://api.github.com/users/plack/received_events","type":"Organization","site_admin":false},"repo":{"id":299695,"name":"Plack","full_name":"plack/Plack","owner":{"login":"plack","id":1691275,"avatar_url":"https://avatars.githubusercontent.com/u/1691275?v=3","gravatar_id":"","url":"https://api.github.com/users/plack","html_url":"https://github.com/plack","followers_url":"https://api.github.com/users/plack/followers","following_url":"https://api.github.com/users/plack/following{/other_user}","gists_url":"https://api.github.com/users/plack/gists{/gist_id}","starred_url":"https://api.github.com/users/plack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plack/subscriptions","organizations_url":"https://api.github.com/users/plack/orgs","repos_url":"https://api.github.com/users/plack/repos","events_url":"https://api.github.com/users/plack/events{/privacy}","received_events_url":"https://api.github.com/users/plack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plack/Plack","description":"PSGI toolkit and server adapters","fork":false,"url":"https://api.github.com/repos/plack/Plack","forks_url":"https://api.github.com/repos/plack/Plack/forks","keys_url":"https://api.github.com/repos/plack/Plack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plack/Plack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plack/Plack/teams","hooks_url":"https://api.github.com/repos/plack/Plack/hooks","issue_events_url":"https://api.github.com/repos/plack/Plack/issues/events{/number}","events_url":"https://api.github.com/repos/plack/Plack/events","assignees_url":"https://api.github.com/repos/plack/Plack/assignees{/user}","branches_url":"https://api.github.com/repos/plack/Plack/branches{/branch}","tags_url":"https://api.github.com/repos/plack/Plack/tags","blobs_url":"https://api.github.com/repos/plack/Plack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plack/Plack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plack/Plack/git/refs{/sha}","trees_url":"https://api.github.com/repos/plack/Plack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plack/Plack/statuses/{sha}","languages_url":"https://api.github.com/repos/plack/Plack/languages","stargazers_url":"https://api.github.com/repos/plack/Plack/stargazers","contributors_url":"https://api.github.com/repos/plack/Plack/contributors","subscribers_url":"https://api.github.com/repos/plack/Plack/subscribers","subscription_url":"https://api.github.com/repos/plack/Plack/subscription","commits_url":"https://api.github.com/repos/plack/Plack/commits{/sha}","git_commits_url":"https://api.github.com/repos/plack/Plack/git/commits{/sha}","comments_url":"https://api.github.com/repos/plack/Plack/comments{/number}","issue_comment_url":"https://api.github.com/repos/plack/Plack/issues/comments{/number}","contents_url":"https://api.github.com/repos/plack/Plack/contents/{+path}","compare_url":"https://api.github.com/repos/plack/Plack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plack/Plack/merges","archive_url":"https://api.github.com/repos/plack/Plack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plack/Plack/downloads","issues_url":"https://api.github.com/repos/plack/Plack/issues{/number}","pulls_url":"https://api.github.com/repos/plack/Plack/pulls{/number}","milestones_url":"https://api.github.com/repos/plack/Plack/milestones{/number}","notifications_url":"https://api.github.com/repos/plack/Plack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plack/Plack/labels{/name}","releases_url":"https://api.github.com/repos/plack/Plack/releases{/id}","created_at":"2009-09-07T06:43:52Z","updated_at":"2015-11-10T20:22:54Z","pushed_at":"2015-11-18T05:49:58Z","git_url":"git://github.com/plack/Plack.git","ssh_url":"git@github.com:plack/Plack.git","clone_url":"https://github.com/plack/Plack.git","svn_url":"https://github.com/plack/Plack","homepage":"http://plackperl.org/","size":6346,"stargazers_count":413,"watchers_count":413,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":168,"mirror_url":null,"open_issues_count":76,"forks":168,"open_issues":76,"watchers":413,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plack/Plack/pulls/538"},"html":{"href":"https://github.com/plack/Plack/pull/538"},"issue":{"href":"https://api.github.com/repos/plack/Plack/issues/538"},"comments":{"href":"https://api.github.com/repos/plack/Plack/issues/538/comments"},"review_comments":{"href":"https://api.github.com/repos/plack/Plack/pulls/538/comments"},"review_comment":{"href":"https://api.github.com/repos/plack/Plack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plack/Plack/pulls/538/commits"},"statuses":{"href":"https://api.github.com/repos/plack/Plack/statuses/f4db58113a54591405102fead4cf435425bc1343"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":49,"deletions":93,"changed_files":3}}