[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Performance deterioration when using integer spin boxes
From:       "Preisig, Heinz A" <heinz.preisig () chemeng ! ntnu ! no>
Date:       2010-09-24 16:55:40
Message-ID: 4C9CD80C.60106 () chemeng ! ntnu ! no
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


OK, problem has been removed, though I do not know what the problem was. 
The issue was that MatPlotLib did not go together with the rest and 
simply got the whole program to a stand-still. I have not had the time 
to check what really was the problem, but it seemed obvious that a long 
queue of events is somewhere in the background generated.

Exchanging the plotting with a PyQwt implementation that is a little 
less luxurious, the problem disappeared. Performance was actually 
significantly improved also when not using any other event-driven parts 
of the interface. Thus looks like PyQwt is recommendable.

Heinz Preisig

On 09/22/2010 05:06 PM, Preisig, Heinz A wrote:
> PS: playing more it is not only the spin box. Other actions taken on 
> the interface slow it down too. Thus it is not a problem with the spin 
> boxes, but must be more generic. Only noticed the problem there first.
>
> On 09/22/2010 04:48 PM, Preisig, Heinz A wrote:
>> Certainly:
>>
>> I am using a timer to generate time events. On each time event I am 
>> doing a computation, in this case a data acquisition (DA converter) 
>> and then a computation the result of which is sent to a DA converter. 
>> The interface has a couple of spin boxes and sliders and buttons to 
>> manipulate what is happening. In the application I am using now, I 
>> replaced the process interface, which actually goes and receives and 
>> sends data to a serial port, by a simple simulation, which 
>> essentially does nothing.
>>
>> What I observe is that when the task executes nicely in the time grid 
>> (1 s). Once I am changing things in a spin box, the task does not 
>> make it to catch the next time event and it keeps on slowing down the 
>> more I am manipulating. I presume there are lots of events being 
>> generated in the background or passed on to other levels.
>>
>> I should mention that this is not the first application of this type. 
>> We wrote one last year and it worked just fine. We used it 
>> extensively at the time on very slow machines. The one I am working 
>> on now is a much faster machine and it runs the newer version of 
>> python and pyqt. On the slow one it gets bugged down tremendously.
>>
>> Not sure what the problem is....
>>
>> Heinz
>>
>> On 09/22/2010 04:04 PM, Hans-Peter Jansen wrote:
>>> On Wednesday 22 September 2010, 15:45:15 Preisig, Heinz A wrote:
>>>    
>>>> I observed that when using integer spin boxes in a timed loop the
>>>> performance drops significantly after changing a value.
>>>>      
>>> Heinz, could you elaborate on "using integer spin boxes in a timed loop" a
>>> bit, please? I don't grasp the concept of it ATM.
>>>
>>> Pete
>>>
>>>    
>>>> After dxchanging
>>>> them by double spin boxes no deterioration was observed.
>>>>
>>>> Heinz Preisig
>>>> _______________________________________________
>>>> PyQt mailing listPyQt@riverbankcomputing.com
>>>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>>>      
>>> _______________________________________________
>>> PyQt mailing listPyQt@riverbankcomputing.com
>>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>>    
>>
>> -- 
>>
>>
>> Heinz A Preisig
>> Professor of Process Systems Engineering 	Private:
>> Øvre Bakklandet 62 B, 7013 Trondheim, Norway
>> Department of Chemical Engineering
>> Norwegian University of Science and Technology
>> N -- 7491 Trondheim, Norway 	Tel direct: +47 735 92807
>> Tel mob: +47 9754 1334
>> e-mail: Heinz.Preisig@chemeng.ntnu.no 
>> <mailto:Heinz.Preisig@chemeng.ntnu.no>
>> web: www.chemeng.ntnu.no\~preisig 
>> <http://www.chemeng.ntnu.no/%7Epreisig>
>>
>>
>>
>> _______________________________________________
>> PyQt mailing listPyQt@riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
> -- 
>
>
> Heinz A Preisig
> Professor of Process Systems Engineering 	Private:
> Øvre Bakklandet 62 B, 7013 Trondheim, Norway
> Department of Chemical Engineering
> Norwegian University of Science and Technology
> N -- 7491 Trondheim, Norway 	Tel direct: +47 735 92807
> Tel mob: +47 9754 1334
> e-mail: Heinz.Preisig@chemeng.ntnu.no 
> <mailto:Heinz.Preisig@chemeng.ntnu.no>
> web: www.chemeng.ntnu.no\~preisig <http://www.chemeng.ntnu.no/%7Epreisig>
>
>
>
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-- 


Heinz A Preisig
Professor of Process Systems Engineering 	Private:
Øvre Bakklandet 62 B, 7013 Trondheim, Norway
Department of Chemical Engineering
Norwegian University of Science and Technology
N -- 7491 Trondheim, Norway 	Tel direct: +47 735 92807
Tel mob: +47 9754 1334
e-mail: Heinz.Preisig@chemeng.ntnu.no <mailto:Heinz.Preisig@chemeng.ntnu.no>
web: www.chemeng.ntnu.no\~preisig <http://www.chemeng.ntnu.no/%7Epreisig>



[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
OK, problem has been removed, though I do not know what the problem
was. The issue was that MatPlotLib did not go together with the rest
and simply got the whole program to a stand-still. I have not had the
time to check what really was the problem, but it seemed obvious that a
long queue of events is somewhere in the background generated. <br>
<br>
Exchanging the plotting with a PyQwt implementation that is a little
less luxurious, the problem disappeared. Performance was actually
significantly improved also when not using any other event-driven parts
of the interface. Thus looks like PyQwt is recommendable.<br>
<br>
Heinz Preisig <br>
<br>
On 09/22/2010 05:06 PM, Preisig, Heinz A wrote:
<blockquote cite="mid:4C9A1B92.8040706@ChemEng.NTNU.NO" type="cite">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
PS: playing more it is not only the spin box. Other actions taken on
the interface slow it down too. Thus it is not a problem with the spin
boxes, but must be more generic. Only noticed the problem there first.<br>
  <br>
On 09/22/2010 04:48 PM, Preisig, Heinz A wrote:
  <blockquote cite="mid:4C9A1751.10304@ChemEng.NTNU.NO" type="cite">
    <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
Certainly:<br>
    <br>
I am using a timer to generate time events. On each time event I am
doing a computation, in this case a data acquisition (DA converter) and
then a computation the result of which is sent to a DA converter. The
interface has a couple of spin boxes and sliders and buttons to
manipulate what is happening. In the application I am using now, I
replaced the process interface, which actually goes and receives and
sends data to a serial port, by a simple simulation, which essentially
does nothing.<br>
    <br>
What I observe is that when the task executes nicely in the time grid
(1 s). Once I am changing things in a spin box, the task does not make
it to catch the next time event and it keeps on slowing down the more I
am manipulating. I presume there are lots of events being generated in
the background or passed on to other levels. <br>
    <br>
I should mention that this is not the first application of this type.
We wrote one last year and it worked just fine. We used it extensively
at the time on very slow machines. The one I am working on now is a
much faster machine and it runs the newer version of python and pyqt.
On the slow one it gets bugged down tremendously. <br>
    <br>
Not sure what the problem is....<br>
    <br>
Heinz<br>
    <br>
On 09/22/2010 04:04 PM, Hans-Peter Jansen wrote:
    <blockquote cite="mid:201009221604.02737.hpj@urpla.net" type="cite">
      <pre wrap="">On Wednesday 22 September 2010, 15:45:15 Preisig, Heinz A wrote:
  </pre>
      <blockquote type="cite">
        <pre wrap="">I observed that when using integer spin boxes in a timed loop \
the performance drops significantly after changing a value.
    </pre>
      </blockquote>
      <pre wrap="">Heinz, could you elaborate on "using integer spin boxes in a timed \
loop" a  bit, please? I don't grasp the concept of it ATM.

Pete

  </pre>
      <blockquote type="cite">
        <pre wrap="">After dxchanging 
them by double spin boxes no deterioration was observed.

Heinz Preisig
_______________________________________________
PyQt mailing list    <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a>
  </pre>
      </blockquote>
      <pre wrap="">_______________________________________________
PyQt mailing list    <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a>
  </pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
    <br>
    <br>
    <table style="text-align: left; width: 785px; height: 124px;"
 border="1" cellpadding="2" cellspacing="1">
      <tbody>
        <tr>
          <td style="width: 50%; vertical-align: top;"><span
 style="font-weight: bold;">Heinz A Preisig</span><br>
Professor of Process Systems Engineering</td>
          <td style="width: 50px; vertical-align: top;"><span style=""
 lang="EN-US">Private: <br>
&Oslash;vre Bakklandet 62 B, 7013 Trondheim, Norway<br>
          </span></td>
        </tr>
        <tr>
          <td style="vertical-align: top;"><span
 style="font-style: italic;">Department
of
Chemical Engineering</span><br>
          <div style="text-align: left;"><span
 style="font-weight: bold; font-style: italic;"></span><span
 style="font-weight: bold; font-style: italic;">Norwegian
University of Science and
Technology&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;"></span><br>
          </div>
          <span style="font-size: 12pt; font-family: &quot;Times New \
Roman&quot;;"></span><span  style="font-weight: bold; font-style: \
italic;"></span><span  style="font-style: italic;">N &#8211; 7491 Trondheim, \
                Norway</span></td>
          <td style="vertical-align: top;">Tel direct:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;



          </span> <span style="" lang="EN-US">+47&nbsp;<span style="">&nbsp; \
</span><span  style="">&nbsp; </span>735
92807<span style=""><br>
          </span></span><span style="" lang="EN-US">Tel mob:<span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span> +47 \
<span style="">&nbsp;&nbsp;&nbsp; </span>9754 1334<br>
          </span><span style="" lang="EN-US">e-mail:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;




          </span><a moz-do-not-send="true"
 href="mailto:Heinz.Preisig@chemeng.ntnu.no">Heinz.Preisig@chemeng.ntnu.no</a><br>
          </span><span style="" lang="EN-US">web:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;




          </span><a moz-do-not-send="true"
 href="http://www.chemeng.ntnu.no/%7Epreisig">www.chemeng.ntnu.no\~preisig</a></span></td>
  </tr>
      </tbody>
    </table>
&nbsp; <span style="font-weight: bold;"></span><br>
    <span style="" lang="EN-US"></span> </div>
    <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
PyQt mailing list    <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></pre>
  </blockquote>
  <br>
  <div class="moz-signature">-- <br>
  <br>
  <br>
  <table style="text-align: left; width: 785px; height: 124px;"
 border="1" cellpadding="2" cellspacing="1">
    <tbody>
      <tr>
        <td style="width: 50%; vertical-align: top;"><span
 style="font-weight: bold;">Heinz A Preisig</span><br>
Professor of Process Systems Engineering</td>
        <td style="width: 50px; vertical-align: top;"><span style=""
 lang="EN-US">Private: <br>
&Oslash;vre Bakklandet 62 B, 7013 Trondheim, Norway<br>
        </span></td>
      </tr>
      <tr>
        <td style="vertical-align: top;"><span
 style="font-style: italic;">Department
of
Chemical Engineering</span><br>
        <div style="text-align: left;"><span
 style="font-weight: bold; font-style: italic;"></span><span
 style="font-weight: bold; font-style: italic;">Norwegian
University of Science and
Technology&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;"></span><br>
        </div>
        <span style="font-size: 12pt; font-family: &quot;Times New \
Roman&quot;;"></span><span  style="font-weight: bold; font-style: \
italic;"></span><span  style="font-style: italic;">N &#8211; 7491 Trondheim, \
                Norway</span></td>
        <td style="vertical-align: top;">Tel direct:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


        </span> <span style="" lang="EN-US">+47&nbsp;<span style="">&nbsp; \
</span><span  style="">&nbsp; </span>735
92807<span style=""><br>
        </span></span><span style="" lang="EN-US">Tel mob:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


        </span> +47 <span style="">&nbsp;&nbsp;&nbsp; </span>9754
1334<br>
        </span><span style="" lang="EN-US">e-mail:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;



        </span><a moz-do-not-send="true"
 href="mailto:Heinz.Preisig@chemeng.ntnu.no">Heinz.Preisig@chemeng.ntnu.no</a><br>
        </span><span style="" lang="EN-US">web:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;



        </span><a moz-do-not-send="true"
 href="http://www.chemeng.ntnu.no/%7Epreisig">www.chemeng.ntnu.no\~preisig</a></span></td>
  </tr>
    </tbody>
  </table>
&nbsp;
  <span style="font-weight: bold;"></span><br>
  <span style="" lang="EN-US"></span>
  </div>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
PyQt mailing list    <a class="moz-txt-link-abbreviated" \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a> <a \
class="moz-txt-link-freetext" \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></pre>
 </blockquote>
<br>
<div class="moz-signature">-- <br>
<br>
<br>
<table style="text-align: left; width: 785px; height: 124px;" border="1"
 cellpadding="2" cellspacing="1">
  <tbody>
    <tr>
      <td style="width: 50%; vertical-align: top;"><span
 style="font-weight: bold;">Heinz A Preisig</span><br>
Professor of Process Systems Engineering</td>
      <td style="width: 50px; vertical-align: top;"><span style=""
 lang="EN-US">Private: <br>
&Oslash;vre Bakklandet 62 B, 7013 Trondheim, Norway<br>
      </span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-style: italic;">Department
of
Chemical Engineering</span><br>
      <div style="text-align: left;"><span
 style="font-weight: bold; font-style: italic;"></span><span
 style="font-weight: bold; font-style: italic;">Norwegian
University of Science and
Technology&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;"></span><br>
      </div>
      <span style="font-size: 12pt; font-family: &quot;Times New \
Roman&quot;;"></span><span  style="font-weight: bold; font-style: \
italic;"></span><span  style="font-style: italic;">N &#8211; 7491 Trondheim, \
                Norway</span></td>
      <td style="vertical-align: top;">Tel direct:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

      </span> <span style="" lang="EN-US">+47&nbsp;<span style="">&nbsp; </span><span
 style="">&nbsp; </span>735
92807<span style=""><br>
      </span></span><span style="" lang="EN-US">Tel mob:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

      </span> +47 <span style="">&nbsp;&nbsp;&nbsp; </span>9754
1334<br>
      </span><span style="" lang="EN-US">e-mail:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


      </span><a href="mailto:Heinz.Preisig@chemeng.ntnu.no">Heinz.Preisig@chemeng.ntnu.no</a><br>
                
      </span><span style="" lang="EN-US">web:<span \
style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


      </span><a href="http://www.chemeng.ntnu.no/%7Epreisig">www.chemeng.ntnu.no\~preisig</a></span></td>
  </tr>
  </tbody>
</table>
&nbsp;
<span style="font-weight: bold;"></span><br>
<span style="" lang="EN-US"></span>
</div>
</body>
</html>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic