views:

57

answers:

1

hello,

So i have a setup where two imacs, imac_1 and imac_2, are connected through firewire. imac_1 sends some debugging information to imac_2 and on imac_2 i have a program in c++ that captures debugging information.(see illustration below)

Now the problem is that if i write the debugging info to the GUI (created using QT) directly its very slow, by slow i mean that the GUI takes time to load the data. So what i did was to write the debugging info to a buffer and then dump that buffer into the GUI but that was also slow because the GUI takes time to load the data.

I was thinking of writing the debugging info to a file and then loading that into the gui. So i would load the first 10,000 lines into the gui and then when the user scrolls down i would load next 10,000 lines.

imac_1(transmitter) --->FireWire (medium) --> imac_2 (receiver)

any ideas or suggestions????

i am using: Mac OS X, XCode, imac

+1  A: 

It sounds like your problem has nothing to do with the two computers communicating, but may instead be your GUI application.

I would suggest you try the file approach you mention, if only to isolate the network component from the discussion. Then work on making your GUI faster.

If you are adding the lines of text one at a time, that might account for some of the slowness, but 10,000 lines isn't really that many.

Other approaches might include turning off redrawing or something similar while you are loading in the text file.

sdg
++ turning off redrawing while loading is a big win in other contexts. You don't want it going through a whole invalidate/paint cycle on every one of the 10k lines.
Mike Dunlavey
i did some graphing of writing to file vs gui and it seems writing to file is faster. But now the problem is when should the gui start loading data from the file after i start the program. Because the file is not going to be updated as soon as the program starts.thanks
rashid
I am thinking of starting a thread from the main thread that will be responsible for the gui stuff, like creating and loading it with data.
rashid