Jump to content

Source code location affects execution speed?!?


Recommended Posts

This is a very strange problem.  I have put together a demo project to demonstrate the speed differences in array vs variant attribute storage methods.  I also included a test of different variant database designs to show some pitfalls.

I first built this project in the following folder on my machine:

C:DevelopmentSourcesandboxVariant Attributes

It seemed to be working well and demonstrating the effects I was after.

I then moved the folder to my desktop:

C:UserslokanisDesktopVariant Attributes

When I opened the project from here, and tested it, the demo ran 1000x faster and no longer demonstrated the effect I was after.

Next I tried moving it to here:

C:tempVariant Attributes

And I got a result closer to the original location but still not the same.

 

Here is the code: Variant Attributes.zip

 

Run the VI: "Compare Class Database Storage Methods.vi"

 

Any ideas what is going on?

 

BTW: the point of the demo is to show that storing large elements in a variant database is faster if you store DVRs of the elements.  This should avoid large data copies.

 

 

Link to comment

Yes, always from inside the project.  I cannot reproduce the 330x result.  This is what I get running outside the project from the desktop:

post-2411-0-33020300-1386715819_thumb.jp

 

Of course, now I get the same results from all locations.  Must have been something weird about my machine at the time.

 

(Also running Win7 and LV2013)

Link to comment

Ooh this sounds familiar.

 

I had some WEIRD performance issues a few weeks back with the divide primitive taking different amounts of time depending on which values it was dividing, and I mean MEASURABLE differences.

 

Closed the project, re-opened and the issue was completely gone (hopefully) never to be seen again.

 

It seemed at the time like the math libraries had started going a bit wonky.

 

As with all problems of this ethereal type (you look at them properly and they disappear) you end up questioning your sanity and have no change of filing a bug report because noone will be able to reproduce it.

 

Shane.

Link to comment

I also had a similar issue where a simple VI using Variant attribute lookup took a long time to execute if the owning library/class was opened.

The time difference was never measured, but running through ~1000 elements was noticeable slower.

 

I tracked this down to be an issue with re-entrancy, once I made the VIs reentrant the execution speed was the same regardless of where it was started.

 

/Jonas

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
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.