12-16-2015 03:25 AM
12-16-2015 03:31 AM - edited 12-16-2015 03:32 AM
@emmazheng wrote:
Thanks for your validation. It is true that TDMS Advanced Synchronous Write performance can be affected by increasing number of TDMS segments in file (TDMS Advanced Synchronous Write is irrelative with a .tdms file of growing size and fixed number of TDMS segments).
Any specific reasons why this is so. To my naive viewpoint, this should not be the case so it would interest me if it's just a missing optimisation or if it's a fundamental limitation of the file format.
emmazheng wrote:The improvements are under research.
Given the trouble I had getting my message across that this problem even exists, would it be possible to be included in the testing of any improvements made? I'm already NDA'd up to my eyeballs.
@emmazheng wrote:
Currently please use TDMS Set Channel Information before multiple continuous synchronous writings.
I already do this (or at least this is what my software SHOULD be doing). Is this meant as a fix to the problem somehow? I don't see the connection at all, sorry.
Shane
12-16-2015 10:48 PM
Hi Intaris,
As to your main VI, if you keep set channel information function and synchronous write function in a loop, no matter outside loop or inside loop, the writing performance would not be improved. Currently I suggest to separate TDMS Set Channel Information from any loop directly or nestedly includes TDMS Advanced Synchronous Write.
In order to make a clear demonstration, I wrote two VIs to compare the writing performance. Both of the VIs create a .tdms file including four channels and every channel includes 1,792,000 samples. The performance graphs are as below.
Original performance:
Improved performance:
The 2012 version VIs are attached.
Jie Zheng
National Instruments R&D
01-04-2016 02:13 AM
OK, I finally got an update on this issue. Thanks to NI Support (Julien) for passing this on.
I was under the impression that Advanced Write did NOT write meta data, this is why I was trying to use it in this way. I think the information given here is a bit misleading.
Compared to the standard TDMS VIs and functions, the Advanced TDMS VIs and functions have the following advantages:
The advanced write function should (afaik) always write to the END of the file (unless I have been fiddling around with the write position). Having previously declared which group / channels I am writing to, I assumed (wrongly apparently) that the driver would cache any offset information it might require for the operation and certainly would not have thought that the function would make a linear search through the file in order to add a byte at the end. That seems a bit..... inefficient.
So either way, the tdms implementation is broken for my application. In order to stream information to disk, it would appear that much more work is being performed than would otherwise actually be neccessary. But that's actually my problem simply because I don't have a "common use case for TDMS advanced functions".
Well guess what. Since TDMS doesn't WORK for my application, it'll probably be staying that way.
Back to the drawing board.
01-04-2016 02:16 AM
A quick thought which just occurred to me.
What does the "Set next Write Position" actually do? Does this allow me to circumvent the entire "Search the file linearly" aspect? Would this work if I had previously written data in one go and then choose to overwrite it bit by bit? Would this help get around the problem with the number of segments? It's kind of defeating the purpose of using TDMS at this stage, but itmight rescue enough to make a new attempt worthwhile.