LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tdms vs spreadsheet

Hello,

 

i have one question regarding logging parameters in file.

When spreadsheet is used for logging, then application use CPU less then 1%, and i'm staisfied with that.

But in case that i log same ammount of data, at same sampling rate with tdms, then CPU usage is 10% or more.

Now question is why TDMS use much more cpu, i thoughts that tdms is more efficient then any other method.

milan87_0-1690272140070.png

milan87_1-1690272160755.png

 

Is anyone can advice how to reduce cpu usage?

Sampling rate is same by spreedsheet and by tdms.

 

Thanks

 

 

0 Kudos
Message 1 of 6
(1,048 Views)

This is just a subVI and we cannot tell how you are measuring. Is the loop rate of the caller the same in both cases? (Maybe it runs much faster in the tdms case?)

 

Please attach some code and a simple testing caller that simulates typical data.

0 Kudos
Message 2 of 6
(1,018 Views)

Thanks for fast reply.

 

loop rate is the same (50ms). Just in case structure is chosen between tdms or spreadsheet.

I noticed that root cause could be that i tested in development enviroment, but when app is created, then cpu percentage is much less.

 

Additional question is when i put to log values every 100ms, then i have only 6 logs per second in file, and not 10.

But it is probably because complete iteration in loop take more time, then 100ms.

 

0 Kudos
Message 3 of 6
(1,007 Views)

You are being lied to by your benchmark.

 

Essentially, the spreadsheet file is already defragmented and TDMS Files are written fragmented.  So, when you ask to get the file size..... oh, yeah 😶 the TDMS File needs to be defragmented and that takes CPU resources.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 6
(963 Views)

TDMS is not really made for streaming strings.  It is highly optimized for raw numeric data.  So that could be causing issues as well.

 

If you are just writing strings, use a text file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(960 Views)

@crossrulz wrote:

If you are just writing strings, use a text file.


.. and use low-level file functions. Open the file at program start, append your strings and increment a separate size counter, then close the file at the end.

 

"Write to delimited spreadsheet" opens and closes the file with each call, requiring much more effort!

 

And yes, the slowest component determines the loop rate, so if you are only getting 6 instead of 10 entries, all bets are off. (Was that text, tdms, or both?).

 

0 Kudos
Message 6 of 6
(934 Views)