LabVIEW

cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Improving this loop

I met (exceeded) the target.

The troffee goes to Tomi!! 

96% improvement!!! 

Thanks!!

๐Ÿ˜„

0 Kudos
Message 11 of 30
(1,135 Views)

Hi gbecker,

Sorry I didn't try out your solution.  I need to deliver the working program in a few minutes.  I hope to find time later to try it.

Thank to everyone!!

RayR

0 Kudos
Message 12 of 30
(1,132 Views)
Thanks for the toffee. Was your speed improvement only 2x as fast as your original code? Weird, I really thought it would speed up by several orders of magnitude.

Tomi

Message Edited by Tomi M on 02-14-2007 08:10 PM

--
Tomi Maila
Message 13 of 30
(1,120 Views)

LOL!! ๐Ÿ˜„

No.. the speed improvement was 6 times for the overall sub-vi.  I would say at least 10 times for just that loop!

Thanks!

RayR

0 Kudos
Message 14 of 30
(1,112 Views)

No.. the speed improvement was 6 times for the overall sub-vi.  I would say at least 10 times for just that loop!


Well, that sounds more realistic Smiley Wink

Tomi
--
Tomi Maila
Message 15 of 30
(1,107 Views)
Hi all,

i just checked on gbecker's solution and i must confess that it is the best one IF the arrays may look a bit different after the rework ๐Ÿ™‚
Both arrays have the blanks removed (ASCII 32) and the numeric array has '0' and '1' instead of '48' and '49'. And all 'x' have been replaced with '0', not only the uppercase-ones. The boolean array has only TRUE for '1's in the numeric array, so all 'x' (which are '0' now) do not have the TRUE in the boolean array.
Since performance is far better (i would say about 100 or more times) this should get the award EXCEPT the arrays have to include the blanks and 'x' mustn't be replaced with '0'.......

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 16 of 30
(1,080 Views)

Thanks Norbert.

I have to check this out as well..  It's always good to learn! ๐Ÿ™‚

We have to give out 2 troffees

๐Ÿ˜„

 

Message 17 of 30
(1,054 Views)

I tried Norbert's approach.  Extremely fast!!

Almost the solution with one caveat...  I need to preserve the "X" and create a String Array (don't ask!!! ๐Ÿ˜ 

However, I do want to get rid of the of the String Array as I don't see any benefits from it.. other than creating an array of "Don't cares".. 

The "X" get converted to a value of zero (0).  Even if I wire a %s to format the Spreadsheet string to array.

Thanks!

RayR

Message Edited by JoeLabView on 02-15-2007 01:06 PM

0 Kudos
Message 18 of 30
(1,041 Views)
Perhaps an initial stage to replace all 'X' chars with an illegal numeric character like '2'?  Then gbecker's inline approach will preserve all the "don't cares" as the numeric value 2, which you could reconvert back to ASCII 'X' if/when needed.
 
There's a string primitive named something like 'Match/Replace Pattern' that would let you specify the regular expression "[xX]" to preserve case-insensitivity.  I'm not 100% sure that's the fastest way to search and replace, but it *is* pretty darn fast.
 
-Kevin P.
CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).



Message 19 of 30
(1,027 Views)
Hi Kevin,
 
Thanks for the suggestion.  Of course!!  Why didn't I think of that???? ๐Ÿ˜ฎ
My brain is definitely on vacation!!!  ๐Ÿ˜‰
 
Yes.. that will definitely work.  I may get a chance to re-visit that code next week (??).  If so, it will get improved.
 
Thanks!
 
RayR
0 Kudos
Message 20 of 30
(1,013 Views)