From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to fast split a string in sub-strings

Solved!
Go to solution

Nope.  Here's the VI.

 

 

0 Kudos
Message 11 of 12
(573 Views)
Solution
Accepted by topic author OnlyOne

Your VI is flawed.  If you don't have the output wired to anything the compiler gets smart and removes code.  I had it taking 0ms when there was no output.  So I added indicators, of course they don't get updated until after the timer is taken.  I also turned off debugging and automatic error handling because these can affect timing tests.  I also don't like having the same message 200000, the compiler may do goofy stuff to optimize that too so I added some variation.

 

After making these changes the match pattern version gave me around 300ms, the spreasheet string to array was around 540ms, and my version with search split string was around 200ms.  When using Search Split string you can right click and choose Match Single Character which I assume adds some optimization to make it faster.

Message 12 of 12
(526 Views)