xpra icon
Bug tracker and wiki

Changes between Initial Version and Version 1 of Profiling/Examples


Ignore:
Timestamp:
12/11/13 10:24:56 (6 years ago)
Author:
Antoine Martin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Profiling/Examples

    v1 v1  
     1= Profiling Examples =
     2
     3{{{#!div class="box"
     4== maths.py re-written in Cython ==
     5Merged in r2462
     6
     7[[BR]]
     8
     9* Before:
     10{{{
     11$ XPRA_CYTHON_MATH=0 ./tests/xpra/test_maths.py
     12calculate_time_weighted_average(100000 records)=(0.5129547191923681, 0.529864013016996)
     13elapsed time: 72.6ms
     14test_calculate_timesize_weighted_average(100000 records)=(70109.42497899215, 22337.16293859974)
     15elapsed time: 204.9ms
     16}}}
     17* After:
     18{{{
     19$ XPRA_CYTHON_MATH=1 ./tests/xpra/test_maths.py
     20calculate_time_weighted_average(100000 records)=(0.5226684212684631, 0.5245391130447388)
     21elapsed time: 4.0ms
     22test_calculate_timesize_weighted_average(100000 records)=(180154.15625, 35980.69140625)
     23elapsed time: 19.7ms
     24}}}
     25Which is 10 to 20 times faster.
     26}}}
     27
     28{{{#!div class="box"
     29== high network cost in UI thread ==
     30Work in progress, see #231
     31}}}
     32
     33{{{#!div class="box"
     34== Fixing an expensive logging call (in a hotpath) ==
     35This is a recurring problem, see: r2294, r2290, etc
     36
     37By running the server with:
     38{{{
     39xpra start :10 --start-child=glxgears
     40}}}
     41And the client with:
     42{{{
     43./tests/scripts/pycallgraph -t draw -i '*' -r 20 -- attach :10 --no-mmap
     44}}}
     45We find that logging is really costing us dearly:
     46[[BR]]
     47[[Image(pycallgraph-draw-loggingisexpensive.png)]]
     48[[BR]]
     49So we remove logging from this critical path in r2484, and we now find:
     50[[BR]]
     51[[Image(pycallgraph-draw-loggingremoved.png)]]
     52[[BR]]
     53That's a saving of about 35% - not bad for such a small change!
     54}}}