Re: [basex-talk] php basex

2018-07-23 Thread Ветошкин Владимир
There is something strange...socket_recv executes much longer than socket_read.. For this:string-join(1 to 10, out:nl())socket_recv takes ~3secsocket_read takes ~1-3ms I don't understand why...  23.07.2018, 13:37, "Ветошкин Владимир" :>> I assume you have communicated with your local BaseX instance?Yes,$session = new Session("localhost", $this->dbport, $this->dblogin, $this->dbpass); 23.07.2018, 13:19, "Christian Grün" : 1. in GUI ~200ms, in PHP ~17sec 2a. ~23sec 2b. ~17secI see. So this clearly indicates that it’s the result size (the numberof results has an effect as well, but it doesn’t seem to be thatdominant). The Java client is much faster indeed. I assume you havecommunicated with your local BaseX instance?  >> 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" : 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 50, 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 Ветошкин Владимир  wrote:  The query:  for $i in (1 to 50)  return $i  In GUI: 200ms  In PHP: 25sec.  it is because of the result size, is it?  23.07.2018, 12:24, "Ветошкин Владимир" :  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" :   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.  --  С уважением,  Ветошкин Владимир Владимирович  --  С уважением,  Ветошкин Владимир Владимирович -- С уважением, Ветошкин Владимир Владимирович   -- С уважением,Ветошкин Владимир Владимирович   -- С уважением,Ветошкин Владимир Владимирович 

Re: [basex-talk] php basex

2018-07-23 Thread Ветошкин Владимир
>> I assume you have communicated with your local BaseX instance?Yes,$session = new Session("localhost", $this->dbport, $this->dblogin, $this->dbpass); 23.07.2018, 13:19, "Christian Grün" : 1. in GUI ~200ms, in PHP ~17sec 2a. ~23sec 2b. ~17secI see. So this clearly indicates that it’s the result size (the numberof results has an effect as well, but it doesn’t seem to be thatdominant). The Java client is much faster indeed. I assume you havecommunicated with your local BaseX instance?  >> 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" : 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 50, 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 Ветошкин Владимир  wrote:  The query:  for $i in (1 to 50)  return $i  In GUI: 200ms  In PHP: 25sec.  it is because of the result size, is it?  23.07.2018, 12:24, "Ветошкин Владимир" :  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" :   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.  --  С уважением,  Ветошкин Владимир Владимирович  --  С уважением,  Ветошкин Владимир Владимирович -- С уважением, Ветошкин Владимир Владимирович   -- С уважением,Ветошкин Владимир Владимирович 

Re: [basex-talk] php basex

2018-07-23 Thread Christian Grün
> 1. in GUI ~200ms, in PHP ~17sec
> 2a. ~23sec
> 2b. ~17sec

I see. So this clearly indicates that it’s the result size (the number
of results has an effect as well, but it doesn’t seem to be that
dominant). The Java client is much faster indeed. I assume you have
communicated with your local BaseX instance?


> >> 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" :
>
> 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 50, 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 Ветошкин Владимир  
> wrote:
>
>
>
>  The query:
>  for $i in (1 to 50)
>  return $i
>
>  In GUI: 200ms
>  In PHP: 25sec.
>
>  it is because of the result size, is it?
>
>
>  23.07.2018, 12:24, "Ветошкин Владимир" :
>
>  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" :
>
>   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.
>
>
>
>  --
>  С уважением,
>  Ветошкин Владимир Владимирович
>
>
>
>
>  --
>  С уважением,
>  Ветошкин Владимир Владимирович
>
>
>
>
> --
> С уважением,
> Ветошкин Владимир Владимирович
>


Re: [basex-talk] php basex

2018-07-23 Thread Ветошкин Владимир
1. in GUI ~200ms, in PHP ~17sec2a. ~23sec2b. ~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" :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 50, out:nl()) ?2. What are the execution times in PHP when runninga) execute('xquery ...')b) query('...') and more()/next() ?I don’t know much about PHP. Maybe there are simple ways to improvethe performance of our client [1]? Suggestions are welcome.Best,Christian[1] https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/php/BaseXClient.phpOn Mon, Jul 23, 2018 at 11:35 AM Ветошкин Владимир  wrote:  The query: for $i in (1 to 50) return $i In GUI: 200ms In PHP: 25sec. it is because of the result size, is it? 23.07.2018, 12:24, "Ветошкин Владимир" : 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" :  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. -- С уважением, Ветошкин Владимир Владимирович -- С уважением, Ветошкин Владимир Владимирович   -- С уважением,Ветошкин Владимир Владимирович 

Re: [basex-talk] php basex

2018-07-23 Thread Christian Grün
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 50, 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 Ветошкин Владимир  wrote:
>
> The query:
> for $i in (1 to 50)
> return $i
>
> In GUI: 200ms
> In PHP: 25sec.
>
> it is because of the result size, is it?
>
>
> 23.07.2018, 12:24, "Ветошкин Владимир" :
>
> 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" :
>
>  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.
>
>
>
> --
> С уважением,
> Ветошкин Владимир Владимирович
>
>
>
>
> --
> С уважением,
> Ветошкин Владимир Владимирович
>


Re: [basex-talk] php basex

2018-07-23 Thread Ветошкин Владимир
The query:for $i in (1 to 50)return $i In GUI: 200msIn PHP: 25sec. it is because of the result size, is it?  23.07.2018, 12:24, "Ветошкин Владимир" :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" : 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 moreinformation, such as a minimized code example that demonstrates yourobservations. Instead of providing your original data, you could e.g.write a little self-contained XQuery _expression_ that creates data ofthe same size.  -- С уважением,Ветошкин Владимир Владимирович   -- С уважением,Ветошкин Владимир Владимирович 

Re: [basex-talk] php basex

2018-07-23 Thread Ветошкин Владимир
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" : 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 moreinformation, such as a minimized code example that demonstrates yourobservations. Instead of providing your original data, you could e.g.write a little self-contained XQuery _expression_ that creates data ofthe same size.  -- С уважением,Ветошкин Владимир Владимирович 

Re: [basex-talk] php basex

2018-07-23 Thread Christian Grün
> 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.