}
}
+// a minimal benchmark - use 3 strategies to execute the same 25 calls: sequentially, using parallel http requests, and
+// using a single system.multiCall request
+
$num_tests = 25;
$data = array(1, 1.0, 'hello world', true, '20051021T23:43:00', -1, 11.0, '~!@#$%^&*()_+|', false, '20051021T23:43:00');
$client = new ParallelClient(XMLRPCSERVER);
-// a minimal benchmark - use 3 strategies to execute the same 25 calls: sequentially, using parallel http requests, and
-// using a single system.multiCall request
-
-echo "Making $num_tests xml-rpc calls...\n";
-flush();
-
// avoid storing http info in the responses, to make the checksums comparable
$client->setDebug(-1);
+echo "Making $num_tests calls to method interopEchoTests.echoValue on server " . XMLRPCSERVER . " ...\n";
+flush();
+
$client->setOption(Client::OPT_NO_MULTICALL, true);
$t = microtime(true);
$resp = $client->send($reqs);
flush();
if (strpos(XMLRPCSERVER, 'http://') === 0) {
- $client->setOption(Client::OPT_NO_MULTICALL, true);
$client->setOption(Client::OPT_USE_CURL, Client::USE_CURL_ALWAYS);
$t = microtime(true);
$resp = $client->send($reqs);
flush();
$client->setOption(Client::OPT_NO_MULTICALL, false);
+// make sure we don't reuse the keepalive handle
+$client->setOption(Client::OPT_USE_CURL, Client::USE_CURL_NEVER);
$t = microtime(true);
$resp = $client->send($reqs);
$t = microtime(true) - $t;
foreach($val1 as $name => $val) {
$out[$name] = array();
foreach($val as $data) {
- $out[$name][] = $data->scalarval();
+ $out[$name][] = $data->scalarVal();
}
}
$result[] = $out;
$response = $dummy->ParseResponse($in, true);
$value = $response->value();
$result = array();
- $l = $value->arraysize();
+ $l = $value->arraySize();
for ($k = 0; $k < $l; $k++) {
- $val1 = $value->arraymem($k);
+ $val1 = $value->arrayMem($k);
$out = array();
foreach($val1 as $name => $val) {
$out[$name] = array();
- $m = $val->arraysize();
+ $m = $val->arraySize();
for ($j = 0; $j < $m; $j++) {
- $data = $val->arraymem($j);
- $out[$name][] = $data->scalarval();
+ $data = $val->arrayMem($j);
+ $out[$name][] = $data->scalarVal();
}
} // while
$result[] = $out;
begin_test('Data decoding (large array)', 'automatic decoding');
for ($i = 0; $i < $num_tests; $i++) {
- $response = $dummy->ParseResponse($in, true, 'phpvals');
+ $response = $dummy->parseResponse($in, true, 'phpvals');
$value = $response->value();
}
end_test('Data decoding (large array)', 'automatic decoding', $value);
if (function_exists('xmlrpc_decode')) {
begin_test('Data decoding (large array)', 'xmlrpc-epi decoding');
for ($i = 0; $i < $num_tests; $i++) {
- $response = $dummy->ParseResponse($in, true, 'xml');
+ $response = $dummy->parseResponse($in, true, 'xml');
$value = xmlrpc_decode($response->value());
}
end_test('Data decoding (large array)', 'xmlrpc-epi decoding', $value);