{"action":"opened","issue":{"url":"https://api.github.com/repos/Intervention/image/issues/847","repository_url":"https://api.github.com/repos/Intervention/image","labels_url":"https://api.github.com/repos/Intervention/image/issues/847/labels{/name}","comments_url":"https://api.github.com/repos/Intervention/image/issues/847/comments","events_url":"https://api.github.com/repos/Intervention/image/issues/847/events","html_url":"https://github.com/Intervention/image/issues/847","id":323169288,"number":847,"title":"loading image from a url too slow","user":{"login":"buddy-yao","id":19948569,"avatar_url":"https://avatars2.githubusercontent.com/u/19948569?v=4","gravatar_id":"","url":"https://api.github.com/users/buddy-yao","html_url":"https://github.com/buddy-yao","followers_url":"https://api.github.com/users/buddy-yao/followers","following_url":"https://api.github.com/users/buddy-yao/following{/other_user}","gists_url":"https://api.github.com/users/buddy-yao/gists{/gist_id}","starred_url":"https://api.github.com/users/buddy-yao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buddy-yao/subscriptions","organizations_url":"https://api.github.com/users/buddy-yao/orgs","repos_url":"https://api.github.com/users/buddy-yao/repos","events_url":"https://api.github.com/users/buddy-yao/events{/privacy}","received_events_url":"https://api.github.com/users/buddy-yao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-15T11:04:19Z","updated_at":"2018-05-15T11:04:19Z","closed_at":null,"author_association":"NONE","body":"# slow code\r\n```\r\n<?php\r\nrequire './vendor/autoload.php';\r\nuse Intervention\\Image\\ImageManager;\r\n$url = 'http://wx.qlogo.cn/mmopen/vi_32/Q3auHgzwzM4wlRp2ickyicuoelRoMUJ8Gl1X8Pr4iaASvL7OGJ6VHibcB4Iv1kRaTTws4FE2kibsyuT6c81mD3ljyZA/0';\r\n$manager = new ImageManager(array('driver' => 'imagick'));\r\n$img = $manager->make($url);\r\n$img->save('img.jpg');\r\n```\r\nexecute time:  \r\n```\r\nroot@9187aca4c6e8:/data/xmq_api# time php testing.php\r\n\r\nreal    0m18.229s\r\nuser    0m0.050s\r\nsys     0m0.010s\r\n```\r\n\r\n\r\n# more faster code\r\n```\r\n<?php\r\nrequire './vendor/autoload.php';\r\nuse Intervention\\Image\\ImageManager;\r\nuse GuzzleHttp\\Client;\r\n$url = 'http://wx.qlogo.cn/mmopen/vi_32/Q3auHgzwzM4wlRp2ickyicuoelRoMUJ8Gl1X8Pr4iaASvL7OGJ6VHibcB4Iv1kRaTTws4FE2kibsyuT6c81mD3ljyZA/0';\r\n$manager = new ImageManager(array('driver' => 'imagick'));\r\n$client = new Client();\r\n$res = $client->get($url);\r\n$img = $manager->make($res->getBody());\r\n$img->save('img.jpg');\r\n```\r\nexecute time:  \r\n```\r\nroot@9187aca4c6e8:/data/xmq_api# time php testing.php\r\n\r\nreal    0m1.769s\r\nuser    0m0.070s\r\nsys     0m0.040s\r\n```\r\n\r\nCould someone tell me why? THX!"}}
{"actor":{"display_login":"buddy-yao"}}