我的旧guzzle代码是否会运行新版本以及需要什么?

I am a Java programmer and new with php. I am experiencing high cpu usage and long transaction times when I acces services using guzzle. Sending small message wil cost me on average half a second. The code below will cost me 0.249 seconds

// Create the REST client
$client = new Client(URL, array(
        'request.options' => array(
                'auth' => array($lgUser, $lgPassword, 'Basic')
        )
));

$time_start = microtime(true);
// Login to the web service
$request = $client->get('/PartnerInformation.svc/Login');
$request = $client->get('/PartnerInformation.svc/Login');
try {
    $response = $request->send();
    $lgSID = $response->xml();
    echo ("Logged in successfully; SID: ".$lgSID);
} catch (Exception $e) {
    echo ("Error while logging in: ".$e);
}
$time_end = microtime(true);
$time_total = $time_end-$time_start;
echo('login time: '.$time_total);

Are there things I can do to speed things up or find the problem?

I found out by looking into the guzzle.phar file that we are using version 3.8.1., would a transfer to a newer version boost the performance and lower the cpu usage? What kind of problems can I expect installing a new goozle version? Will it be enough to change the guzzle.phar file?

You can read about changes and breakwards in official documentation. However as I see from pasted code there is no changes.

Architecturally speaking, there are some huge differences between 3.8 and 5.2. 5.x makes more use of closures and anonymous functions. I've found it to be more resource friendly.

Guzzle, by default, will utilize libcurl. Ultimately, any performance increase observed will be marginal due to the common underpinning.

I'd recommend upgrading into the 5.x series, and possibly even start looking at the 6.x (still in development), if for nothing else then the fact that it is actively being developed and maintained.

There are some significant changes you will need to be aware of. The most prominant of these is the fact that the "lazy methods" (get, post, header, etc, etc) will perform the request and return a Response object.

I've found the Guzzle Docs a vital resource.