From 354ca924609a07a4a4b93198097c1efc4ce4015c Mon Sep 17 00:00:00 2001 From: ekharisma Date: Sun, 27 Jun 2021 02:37:51 +0700 Subject: [PATCH 1/3] improve get with params performance --- .~lock.Hasil.ods# | 1 + Hasil.ods | Bin 0 -> 13033 bytes composer.lock | 18 ++++++++++++++++++ example/index.php | 11 ++++++++--- src/Curl.php | 41 +++++++++++++++++++++++++++-------------- 5 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 .~lock.Hasil.ods# create mode 100644 Hasil.ods create mode 100644 composer.lock diff --git a/.~lock.Hasil.ods# b/.~lock.Hasil.ods# new file mode 100644 index 0000000..43d54cb --- /dev/null +++ b/.~lock.Hasil.ods# @@ -0,0 +1 @@ +,DESKTOP-2GSR8J5/Ekky,DESKTOP-2GSR8J5,27.06.2021 02:24,file:///C:/Users/Ekky/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/Hasil.ods b/Hasil.ods new file mode 100644 index 0000000000000000000000000000000000000000..2e3c6611ff76d2e501bcc7f9df0523ad1d484578 GIT binary patch literal 13033 zcmdUWbyyr(^DYSxB!pnW-Q5We!QCNf@PVL%4KBgm-Q8V+ySux)yE~VB_wFyd-`(B& z_pN!l=S)9S?>VQsyQ=!s+p-ei5GY_^&|qLNiSzQ_rtAToW=3WJ8wU%3 zj)jG(k)Do?5zw5@)?A+!sAFwpO$)RDnCk=eKxP1Q8(M1%D}au^^>+ZkM)oh5uQ2~3 zn6E7Xpt*sOA;{`KXx5B$7C;M-#VZ7e?w|G0|3>eZimr~;zi46qjh2NK(9jBCZT;_> zf7hQ45NP`ET7Ne?Ya1OK(Ep=1yuTTzk(rJmz?zQV$i_^^!unq(`FBG#Fa_$^0RGK1 ze>c=$6SUAV2blg#Z+~Y}9X&mODd6>d0{`d{8XEdPm(%OK{zu?mTV^`uMg{^8PyG)K(TB6-c`C1f=EWkjSrcSq1y4lN%+%Oe-N( ziAOrvy@3^ZZHml#6eRtk-+%5=aWv4@WiN2d&sJ06CE%P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o=XD zWMSDlI4~Y4q1_%<0Pq~Eq`l{9m>!T9%7Td(=7k%Y)VdTS5OrkQvsaf>BXEO{GbUBo z3aYP}khwaRO>RBXW4%H#=%17+9h$i6r&0hVs~wA=}jMn;suSf^-$R6C0-PxA@!+;AMYw*!DgqzntI_ zsbUS4vj@5)5{6>Gw483kdG{iIB&_V^$L>q=%FJCKFhnngH(VYg)se$hB`bs=W&cEa z?U{sx46P%^aWOM!PPo5{owMmfFw@!#h&qh)xqF}vpS~wPk{xuRts61onNAc_@%304 zW9B1X;Ts=paGs!yjmqqzAL3v*)xXJju-YA)m?C1HC;-`-O7F-c6d zD)N4VDUH8uvy)|_)ECbHoJQqG|HyjynpkRLR->k~(=a!tQ&|%NGq>Lw)V;7B3 z+XL6$S$NGDLj=g4nXke(^pZ1b zC@_~9?dJbBzj0^q#n9v+ZFiL3a%P4GVmGK@4?9hV62fGDER0RJrw8u#agWOzx*Mu*m^ICk z16@q7#0zSOUsiwf76t5|`R2cpm*4US`~1JPe*fdOIP~WqV2ZE5{*7P$*WUlE`m4b7 zTY_Gj|BdsTZ~o6Hzv$7wrTw+}-zb0OpZ_z`U&r(KH%Pzv=>LrJSL-moo`wG&&!73} z|BUmCq5fNp{|4v(;;a8N*k7lX`!`^}`Ro6T^4F;?{SC^W`RxCU^Vd`M>Fxh*qQCOn z|2NVfj^oed?O!?dZ;^RL`XBG{%6I?cBK|}3&xEsIrOV$E@>;k2P4)h7y+8Aqe$ml> z3(6~b>GgGu|B%!ETkFqN)?XZ_-*WXjY`x!%r#}?`sR;X9G5Ga1{-=`cA1HrJ_RpU8 vuVz{z`Rjwoe{25Pd;IduzvY(tAN;he1mvre2LnTV{QzE_j`^>*S-}1mBlUW! literal 0 HcmV?d00001 diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..aade33f --- /dev/null +++ b/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "5d168508890ed103e7f89cc597b50013", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/example/index.php b/example/index.php index 6aa798e..6ccc5b3 100644 --- a/example/index.php +++ b/example/index.php @@ -1,8 +1,13 @@ get('http://belanja-api.herokuapp.com'); +for ($i=0; $i < 10; $i++) { + $response = $curl->get('http://belanja-api.herokuapp.com', ["users_id" => 2]); +} +$finishTime = microtime(true); -echo $response; \ No newline at end of file +echo "Time elapsed: ". $response; +echo "
"; +echo $finishTime - $startTime; \ No newline at end of file diff --git a/src/Curl.php b/src/Curl.php index a11e938..8a70736 100644 --- a/src/Curl.php +++ b/src/Curl.php @@ -77,7 +77,8 @@ * ]; * ``` */ -class Curl { +class Curl +{ const VERSION = 'Curl-PHP-' . PHP_VERSION; @@ -138,7 +139,8 @@ class Curl { */ private $files = array(); - public function __construct() { + public function __construct() + { $this->userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : self::VERSION; } @@ -149,11 +151,14 @@ public function __construct() { * @param array $vars queryParams * @return string response */ - public function get($url, $vars = array()) { - if (!empty($vars)) { + public function get($url, $vars = null) + { + if (isset($vars)) { $url .= (stripos($url, '?') !== false) ? '&' : '?'; $url .= (is_string($vars)) ? $vars : http_build_query($vars, '', '&'); } + echo $url; + echo "
"; return $this->request(self::GET, $url); } @@ -163,7 +168,8 @@ public function get($url, $vars = array()) { * @param array $vars postFields * @return string response */ - public function post($url, $vars = array()) { + public function post($url, $vars = array()) + { return $this->request(self::POST, $url, $vars); } @@ -173,7 +179,8 @@ public function post($url, $vars = array()) { * @param array $vars postFields * @return string response */ - public function put($url, $vars = array()) { + public function put($url, $vars = array()) + { return $this->request(self::PUT, $url, $vars); } @@ -183,7 +190,8 @@ public function put($url, $vars = array()) { * @param array $vars postFields * @return string response */ - public function delete($url, $vars = array()) { + public function delete($url, $vars = array()) + { return $this->request(self::DELETE, $url, $vars); } @@ -193,7 +201,8 @@ public function delete($url, $vars = array()) { * @param array $vars [file as key->value] * @return string response */ - public function upload($url, $vars = array()) { + public function upload($url, $vars = array()) + { foreach ($vars as $fieldName => $fileName) { $this->files[] = [ @@ -253,7 +262,8 @@ private function generateBoundary() * @param array $vars * @return string response */ - private function request($method, $url, $vars = array()) { + private function request($method, $url, $vars = array()) + { $this->error = ''; $this->request = curl_init(); if (is_array($vars)) @@ -271,7 +281,8 @@ private function request($method, $url, $vars = array()) { * @param string $method * @return void */ - private function setRequestMethod($method) { + private function setRequestMethod($method) + { switch ($method) { case self::GET: @@ -294,7 +305,8 @@ private function setRequestMethod($method) { * @param string $vars * @return void */ - private function setRequestOptions($url, $vars) { + private function setRequestOptions($url, $vars) + { curl_setopt($this->request, CURLOPT_URL, $url); curl_setopt($this->request, CURLOPT_TIMEOUT, $this->timeout); @@ -313,7 +325,8 @@ private function setRequestOptions($url, $vars) { * [setRequestHeaders] * @return void */ - private function setRequestHeaders() { + private function setRequestHeaders() + { $headers = array(); foreach ($this->headers as $key => $value) { $headers[] = $key . ': ' . $value; @@ -325,7 +338,8 @@ private function setRequestHeaders() { * [generateResponse] * @return string response */ - private function generateResponse() { + private function generateResponse() + { $response = curl_exec($this->request); $header_size = curl_getinfo($this->request, CURLINFO_HEADER_SIZE); @@ -340,5 +354,4 @@ private function generateResponse() { return $content; } - } From 05c9c89683a0eba60d5c0879e0198f562944774d Mon Sep 17 00:00:00 2001 From: ekharisma <65415399+ekharisma@users.noreply.github.com> Date: Sun, 27 Jun 2021 02:55:49 +0700 Subject: [PATCH 2/3] Update index.php Delete some residual benchmark --- example/index.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/example/index.php b/example/index.php index 6ccc5b3..14fdd3e 100644 --- a/example/index.php +++ b/example/index.php @@ -1,13 +1,9 @@ get('http://belanja-api.herokuapp.com', ["users_id" => 2]); } -$finishTime = microtime(true); -echo "Time elapsed: ". $response; -echo "
"; -echo $finishTime - $startTime; \ No newline at end of file +echo $response; From 944390209de16780feb3632d68cf269a7b02875c Mon Sep 17 00:00:00 2001 From: ekharisma <65415399+ekharisma@users.noreply.github.com> Date: Sun, 27 Jun 2021 02:56:40 +0700 Subject: [PATCH 3/3] Update Curl.php Delete residual debug --- src/Curl.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Curl.php b/src/Curl.php index 8a70736..507326f 100644 --- a/src/Curl.php +++ b/src/Curl.php @@ -157,8 +157,6 @@ public function get($url, $vars = null) $url .= (stripos($url, '?') !== false) ? '&' : '?'; $url .= (is_string($vars)) ? $vars : http_build_query($vars, '', '&'); } - echo $url; - echo "
"; return $this->request(self::GET, $url); }