Results 1 to 3 of 3

Thread: Erratic performance of IO operations in Qt4 program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Erratic performance of IO operations in Qt4 program

    Hi,

    Somewhere in a qt4 program, I launch a thread, that will do some IO operations in a file...
    I'm trying to time this operation...
    Qt Code:
    1. t.start();
    2.  
    3. SegDIO_getRMS(mFilename.data(), mSegdAttributes->averaged, mSegdAttributes);
    4.  
    5. qDebug("Time to extract datasquare: %d ms", t.elapsed());
    To copy to clipboard, switch view to plain text mode 

    all three parameters of the function SegDIO_getRMS are pointers... (to char*, float* and pointer to a custom struct....)

    Now there is a timer also in the called function, wrapping all operations...

    At the beginning, the 2 timers are in agreement... everything's as fast as it should...but after some time,
    the outside time is reporting times that are 5 times bigger than the inside timer...

    Unless I'n not understanding something properly , the only operations made between these 2 timers are
    locating the position in memory of the function and copy 3 pointers to it... that is reported during almost a full second...
    which makes no sense...

    I'm out of ideas of how to diagnostic the problem...

    Does somebody has an idea of what's going on?

    EDIT: additional info:
    monitoring the I/O with iostat confirms that something goes to hell when timing become inconsistent :
    Qt Code:
    1. Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
    2. sda 26.50 232.00 16.00 464 32
    3. sr0 0.00 0.00 0.00 0 0
    4.  
    5. Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
    6. sda 14.50 120.00 16.00 240 32
    7. sr0 0.00 0.00 0.00 0 0
    8.  
    9. Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
    10. sda 1578.50 30748.00 0.00 61496 0
    11. sr0 0.00 0.00 0.00 0 0
    12.  
    13. Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
    14. sda 3230.50 63684.00 28.00 127368 56
    15. sr0 0.00 0.00 0.00 0 0
    To copy to clipboard, switch view to plain text mode 
    Last edited by jcox23; 26th January 2010 at 15:26.

Similar Threads

  1. Multithreaded per pixel operations on QImage
    By N¤X in forum Qt Programming
    Replies: 8
    Last Post: 14th September 2009, 12:29
  2. String operations, printing to stdout
    By Cruz in forum Newbie
    Replies: 3
    Last Post: 20th January 2009, 15:30
  3. Replies: 7
    Last Post: 19th January 2008, 15:29
  4. How to manage QSqlTableModel database operations?
    By Abk in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2007, 10:44
  5. Graphics operations - Qt 4.1
    By hoborg in forum Newbie
    Replies: 1
    Last Post: 18th February 2006, 14:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.