Jump to content

Fastest Search Array of String


Recommended Posts

Maybe something like this:

test.vi

search.vi

The recursive VI approach along with the Build Array is not memory efficient. Seems a more complicated solution. My preference is the preallocation of arrays with the swap/cut method.

Focusing exclusively on timing, it appears that about 80-90% of the time expense of these routines is taken up by the Search/Split String primitive. Even changing out the swap/cut method for a build array only increases processing time by 10%, whereas deleting the Search/Split String and replacing it with a constant zero on the case input reduces overall timing 80-90%. This shows that no real significant timing gains can be achieved without a focus on improving the primitive.

EDIT: Ok, just read page 2 (duh, should make sure I remember to flip the page!) I did assume that the match could be anywhere in the string.

Edited by Slacter
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.