11-22-2017 08:41 AM
@rbrown_acertaralabs wrote:
I'm pasting screenshots of the VI block diagrams rather than the source code, since images can be viewed immediately in the browser.
Is there a reason you didn't post it as a snippet which is also viewable in the browser and executable code? Or post the pictures and a zip of the source?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-22-2017 12:08 PM
Good idea to run it with case-insensitive match. To my surprise, this made a HUGE difference and drastically increased the time required for the string case:
For the string case, one of the items is set as the Default case. I have posted the above results in the latest post to this topic (along with source code).
11-22-2017 12:12 PM
I intentionally did not randomly select the strings (nor the ints from the enum) during loop execution since random selection processing would add to the processing time for both the enum case and the string case. I wanted the timing to be strictly based on the case selection logic. Thus, the string array is pre-populated and the enum int array is pre-populated. However, both are pre-populated (before the timing begins) in a random order.
You are correct that the pre-populated enum int array could have duplicates -- I have fixed this and re-posted the new results in my latest post to this topic. It did not significantly change the results:
11-22-2017 12:12 PM
Thanks for pointing out the snippet option. I have now simply posted the entire source code in my latest post on this topic.
11-22-2017 12:18 PM
Latest results, screenshots, and source code attached.
Results:
11-22-2017 12:19 PM
Still no source code, but nice testing.
mcduff
11-22-2017 12:20 PM
see previous post for source code
11-22-2017 12:25 PM
Try it with Disable Debugging, you may be surprised.
mcduff
11-22-2017 01:00 PM
@mcduff wrote:
Try it with Disable Debugging, you may be surprised.
The reason for the "surprise" is Constant Folding. Nothing is coming out of these case structures, so they will likely be removed from the compiled code when debugging has been disabled. If there was a value that came out of the case structure and wrote to a control, then we would have a more valid benchmark.
11-22-2017 01:01 PM
@crossrulz Thanks for the explanation.