LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Which is faster, a string search or a 1-d array search?

Which is faster? Searching a string or seaching a 1-d array of lets say 16 bit words?

0 Kudos
Message 1 of 4
(2,640 Views)

I should add that I'm using LabVIEW 2010.

0 Kudos
Message 2 of 4
(2,639 Views)

I'm not sure. Maybe someone knows. For what it's worth when I want to time something I use this.

 

Capture.PNG

 

=====================
LabVIEW 2012


0 Kudos
Message 3 of 4
(2,615 Views)

They are both very fast .... In the time it took to ask the question, you probably could have benchmarked it yourself. 😄

 

The question is a bit vague.

 

 

  • Do you need to find the first match or all matches?
  • How big is the array or the string?
  • What are you searching for in the string, also 2 adjacent bytes? Do they need to be start with an even numbered element position?
  • Where is the data coming from? What is the original datatype?
  • Can we make additional assumptions? (e.g. if the array is sorted, we could do a binary search).

 

0 Kudos
Message 4 of 4
(2,606 Views)