ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Spreadsheet String To Array DBL Performance Improvement

 

While developing and profiling a batch data-analysis program, I found that the "Read From Spreadsheet File.vi" function was where the majority ofthe execution time was spent.  Digging further, I found the time was spent in the "Spreadsheet String To Array" function.  Obviously I cannot look inside this function, but I wondered if I can somehow speed it up.  Attached is a Vi that illustrates what I came up with as an alternative.

 

Basically using "Spreadsheet String To Array" only to split it up to a 2D String Array, and then "Fract/Exp String to Number" to convert the strings to numbers.

 

It consistently runs in just over 60% of the time of using Spreadsheet String To Array on it's own to do the conversion.

 

I am curious as to why using the two functions is quicker than just the one on it's own? Perhaps NI can improve the internals a bit?  Or perhaps it is not a fair comparison?

 

Labview 8.6f1 Win XP SP2

Message Edited by pauldavey on 03-25-2009 02:55 PM
Message 1 of 6
(4,437 Views)
Nice post paul Smiley Wink
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 2 of 6
(4,426 Views)
Thank you for bringing this to our attention! I will be putting forward this question to our R&D department. If I do find any useful information, I will go ahead and post it here. 
Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 3 of 6
(4,370 Views)

FYI:  This behavior is still there in LabVIEW 2010.

0 Kudos
Message 4 of 6
(3,682 Views)

Adding a couple of other conversions to test against i noticed that:

1. Scan from string through a double loop was the slowest

2. Scan Value was slightly faster

3. Direct conversion through Spreadsheet to array as in OP

4. 2-step convert through Fract/Exp.

 

Could it be that Spreadsheet to array uses Scan Value internally?

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 6
(3,660 Views)

Hello Yamaeda,

 

Would you be willing to post your code here?  I would like to take a closer look and inform our R&D department if necessary.

 

Lynn

National Instruments
Senior Systems Engineer
0 Kudos
Message 6 of 6
(3,622 Views)