On Tue, 10 Nov 2015 13:19:56 +0100
Stefano Miccoli mo...@icloud.com wrote:

> Do you experience slow dir times only on the root / or also on the
> sensors? say something like ?/system/? that should not require any bus
> activity?

So I've learned how to use the timing test program more intelligently. You can 
read many of the same things that show in the httpserver by adding paths to the 
command line. My default "dir" tests are still much slower than other people 
report, but if I read a cached temperature, or a fixed value, my times are not 
so bad. 

The 
statement: proxy_obj.dir("/")
line shows what was read, in this case the default test when you don't specify 
something else. 

Reading an uncached temperature with the default iteration count took far 
longer than I was willing to wait, probably a couple of minutes:
statement: proxy_obj.read("/uncached/28.884d88000000/temperature")

So I cut back by a factor of 25 for later tests:
>python StefanoTimingTest.py3 -n 2 -r 2 
>owserver://10.1.1.4:4304/uncached/28.884d88000000/temperature


My slow default dir test:

>python StefanoTimingTest.py3 owserver://10.1.1.4:4304
statement: proxy_obj.dir("/")
** non persistent : 44.21 ms, 44.27 ms, 46.81 ms, 47.25 ms, 47.36 ms,
** persistent     : 37.20 ms, 43.46 ms, 44.35 ms, 45.04 ms, 46.49 ms,

>python StefanoTimingTest.py3 owserver://10.1.1.4:4304
statement: proxy_obj.dir("/")
** non persistent : 44.79 ms, 47.74 ms, 48.77 ms, 63.80 ms, 64.26 ms,
** persistent     : 40.73 ms, 41.59 ms, 54.08 ms, 61.37 ms, 61.55 ms,


Fixed values: 

>python StefanoTimingTest.py3 owserver://10.1.1.4:4304/28.884D88000000/family
statement: proxy_obj.read("/28.884D88000000/family")
[Errno 1] Startup - command line parameters invalid: '/28.884D88000000/family'

>python StefanoTimingTest.py3 owserver://10.1.1.4:4304/28.884D88000000/type
statement: proxy_obj.read("/28.884D88000000/type")
** non persistent :  4.01 ms,  4.09 ms,  4.43 ms,  4.50 ms,  4.52 ms,
** persistent     :  1.63 ms,  1.69 ms,  1.72 ms,  1.74 ms,  1.95 ms,

>python StefanoTimingTest.py3 owserver://10.1.1.4:4304/28.884D88000000/power
statement: proxy_obj.read("/28.884D88000000/power")
** non persistent :  3.88 ms,  3.95 ms,  4.06 ms,  4.37 ms,  4.51 ms,
** persistent     :  1.71 ms,  1.75 ms,  1.80 ms,  1.85 ms,  2.36 ms,


Temperatures:

>python StefanoTimingTest.py3 
>owserver://10.1.1.4:4304/28.884D88000000/temperature
statement: proxy_obj.read("/28.884D88000000/temperature")
** non persistent :  4.63 ms,  4.85 ms,  5.19 ms,  5.21 ms,  6.89 ms,
** persistent     :  2.05 ms,  2.22 ms,  2.31 ms,  2.37 ms,  2.67 ms,

>python StefanoTimingTest.py3 
>owserver://10.1.1.4:4304/28.d64788000000/temperature
statement: proxy_obj.read("/28.d64788000000/temperature")
** non persistent :  4.55 ms,  4.59 ms,  5.23 ms,  5.24 ms,  5.36 ms,
** persistent     :  2.15 ms,  2.15 ms,  2.25 ms,  2.29 ms,  2.52 ms,


Fewer reps (time numbers still comparable):

>python StefanoTimingTest.py3 -n 2 -r 2 
>owserver://10.1.1.4:4304/28.d64788000000/temperature
statement: proxy_obj.read("/28.d64788000000/temperature")
number: 2
repetitions: 2
** non persistent :  4.39 ms,  4.42 ms,
** persistent     :  2.03 ms,  3.24 ms,

>python StefanoTimingTest.py3 -n 2 -r 2 
>owserver://10.1.1.4:4304/uncached/28.d64788000000/temperature
statement: proxy_obj.read("/uncached/28.d64788000000/temperature")
number: 2
repetitions: 2
** non persistent : 1072.08 ms, 1073.56 ms,
** persistent     : 1204.99 ms, 1701.97 ms,

>python StefanoTimingTest.py3 -n 2 -r 2 
>owserver://10.1.1.4:4304/uncached/28.884d88000000/temperature
statement: proxy_obj.read("/uncached/28.884d88000000/temperature")
number: 2
repetitions: 2
** non persistent : 2132.88 ms, 2136.67 ms,
** persistent     : 1202.56 ms, 1205.10 ms,

>python StefanoTimingTest.py3 -n 2 -r 2 
>owserver://10.1.1.4:4304/uncached/28.884d88000000/temperature
statement: proxy_obj.read("/uncached/28.884d88000000/temperature")
number: 2
repetitions: 2
** non persistent : 1072.14 ms, 1094.32 ms,
** persistent     : 1399.37 ms, 1400.18 ms,


Back to default dir - I wonder how the first one came out faster than usual? 

>python StefanoTimingTest.py3 -n 2 -r 2 owserver://10.1.1.4:4304
statement: proxy_obj.dir("/")
number: 2
repetitions: 2
** non persistent : 28.46 ms, 48.92 ms,
** persistent     : 43.34 ms, 46.25 ms,

>python StefanoTimingTest.py3 -n 2 -r 2 owserver://10.1.1.4:4304
statement: proxy_obj.dir("/")
number: 2
repetitions: 2
** non persistent : 49.77 ms, 53.75 ms,
** persistent     : 43.48 ms, 45.85 ms,


So why would my directory listing take so much longer than other systems? Could 
it be w1 versus USB or I2C? My system doesn't have the normal owfs virtual 
directories, it has w1's version in a different location. Maybe it has to do 
more work to create the dir info? But I thought the point of owserver was to 
have all that info cached and ready...  


Running the test program on the BBB:

ubuntu@arm:~/Lpkg$ python3 StefanoTimingTest.py3  -n 2 -r 2 
owserver://10.1.1.4:4304/uncached/28.884d88000000/temperature
pyownet: ver. 0.8.2 (/usr/local/lib/python3.4/dist-packages/pyownet/__init__.py)
proxy_obj: ownet server at ('10.1.1.4', 4304)
server info: pid 933, ver. unknown

timeit:
statement: proxy_obj.read("/uncached/28.884d88000000/temperature")
number: 2
repetitions: 2

** non persistent : 1085.39 ms, 1606.32 ms,
** persistent     : 1070.52 ms, 1071.16 ms,


ubuntu@arm:~/Lpkg$ python3 StefanoTimingTest.py3  -n 2 -r 2 
owserver://10.1.1.4:4304/28.884d88000000/temperature
statement: proxy_obj.read("/28.884d88000000/temperature")
** non persistent :  6.58 ms,  6.89 ms,
** persistent     :  4.66 ms,  5.16 ms,


ubuntu@arm:~/Lpkg$ python3 StefanoTimingTest.py3  -n 2 -r 2 
owserver://10.1.1.4:4304/28.884d88000000/type
statement: proxy_obj.read("/28.884d88000000/type")
** non persistent :  2.57 ms,  2.75 ms,
** persistent     :  1.28 ms,  1.93 ms,


Fixed values a bit faster, temps slower, uncached about the same. Guess that 
makes sense. 

Loren

| Loren Amelang | lo...@pacific.net |




------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to