BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


@altenbach wrote:

@Yamaeda wrote:
If you add a U8 to a I32, to you explicitly convert the U8 first? 😉 I mean, the code is more correct, but the extra blocks makes it a little harder to read, since i always think "why are they doing this explicit conversion?".

In addition, an explicit conversion is sometimes more expensive. (Example, but you would think the compiler should create identical code. I have not tested in recent version) 


Debug still turned on? My impression was that the explicit conversion was making more places that could be probed, etc. With debugging off, I would expect identical code.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2631 of 2,638
(1,058 Views)

@crossrulz wrote:
With debugging off, I would expect identical code.

In principle, there is still an extra memory allocation of the lower DBL array while the multiplication might know how to multiply an integer with a DBL directly. No time for extensive tests at the moment ....

Message 2632 of 2,638
(1,044 Views)

@altenbach wrote:

@Yamaeda wrote:
If you add a U8 to a I32, to you explicitly convert the U8 first? 😉 I mean, the code is more correct, but the extra blocks makes it a little harder to read, since i always think "why are they doing this explicit conversion?".

In addition, an explicit conversion is sometimes more expensive. (Example, but you would think the compiler should create identical code. I have not tested in recent version)

 

CoercionIsFaster.png


Yeah i remember that little nugget. I assume it allocates a new array or something. Maybe Bool to number should have configurable output like the Multiply has?

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2633 of 2,638
(973 Views)

@Yamaeda wrote:
Maybe Bool to number should have configurable output like the Multiply has?

exactly 😄

0 Kudos
Message 2634 of 2,638
(963 Views)

@altenbach wrote:

@Yamaeda wrote:
Maybe Bool to number should have configurable output like the Multiply has?

exactly 😄


It was only suggested in 2009, give'em some time! 😉

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

Qestit Systems
Certified-LabVIEW-Developer
Message 2635 of 2,638
(886 Views)

I have no intention debugging this mess, but here's a small section that I think tries to do a rolling average.

 

altenbach_0-1770657046326.png

 

 

(so what's wrong with the ptbypt version???)

0 Kudos
Message 2636 of 2,638
(206 Views)

The original programmer didn't see it on the pallets, didn't recognize what it does?

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2637 of 2,638
(124 Views)

@altenbach wrote:

I have no intention debugging this mess, but here's a small section that I think tries to do a rolling average.

 

...

(so what's wrong with the ptbypt version???)



I'm sure I have made something like this with shift registers, when I was using LV 5.0 and was new to LabVIEW.

Certified LabVIEW Architect
Message 2638 of 2,638
(96 Views)