jadell / neo4jphp

PHP wrapper of the Neo4j REST interface
Other
532 stars 137 forks source link

Increase speed #191

Open stefanak-michal opened 3 years ago

stefanak-michal commented 3 years ago

Hi.

I've two suggestion to improve speed of curl connection.

  1. Class Transport constructor should call gethostbyname() if the host isn't IP. It will resolve hostname to IP and it's faster if you avoid DNS resolve every time.
    $this->host = filter_var($ip, FILTER_VALIDATE_IP) ? $host : gethostbyname($host);
  2. Enable gzip on cURL curl_setopt($c, CURLOPT_ENCODING, '')