1. in GUI ~200ms, in PHP ~17sec
2a. ~23sec
2b. ~17sec
 
>> Maybe there are simple ways to improve the performance of our client [1]?
Maybe... I'll try to explore this issue better.
 
23.07.2018, 12:44, "Christian Grün" <christian.gruen@gmail.com>:

Hi Vladimir,

Thanks for the example. This is quite an impressive difference indeed.
Two more questions:

1. What is the execution time for running string-join(1 to 500000, out:nl()) ?

2. What are the execution times in PHP when running
a) execute('xquery ...')
b) query('...') and more()/next() ?

I don’t know much about PHP. Maybe there are simple ways to improve
the performance of our client [1]? Suggestions are welcome.

Best,
Christian

[1] https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/php/BaseXClient.php



On Mon, Jul 23, 2018 at 11:35 AM Ветошкин Владимир <en-trance@yandex.ru> wrote:

 
 The query:
 for $i in (1 to 500000)
 return $i

 In GUI: 200ms
 In PHP: 25sec.

 it is because of the result size, is it?


 23.07.2018, 12:24, "Ветошкин Владимир" <en-trance@yandex.ru>:

 Probably, it's because of the result size (~1.5mb).
 When I reduce the count of the returning data - execution time decreases.
 The php-code of measuring execution time:
 $time_start = microtime(true);
 while ($query->more()) {
 $q = $query->next();
 }
 $time_end = microtime(true);
 $execution_time = ($time_end - $time_start);
 echo $execution_time;

 I'll try to do this:
 >> you could e.g. write a little self-contained XQuery expression that creates data of the same size.


 23.07.2018, 11:53, "Christian Grün" <christian.gruen@gmail.com>:

  One thing puzzles me. Why does the same query take different execution time in GUI and PHP ?
  In GUI - 2.5-3sec, in PHP - 8-10sec.


 There are too many factors that influence execution time (bandwidth,
 result size, etc.), so you will need to provide us with more
 information, such as a minimized code example that demonstrates your
 observations. Instead of providing your original data, you could e.g.
 write a little self-contained XQuery expression that creates data of
 the same size.



 --
 С уважением,
 Ветошкин Владимир Владимирович




 --
 С уважением,
 Ветошкин Владимир Владимирович
 
 
 
-- 
С уважением,
Ветошкин Владимир Владимирович