Jump to content

getting the name of a class - speed improvements


Recommended Posts

LV 2013 added a new function (or just exposed it) that gets the name of a class.

 

I wanted to see if this would be faster than the old method I used before based on the path of the class.  So I created a little experiment.  It turns out the new functions is MUCH faster.

I am concerned that what I am seeing is real, however, and not due to some compiler optimization with the way I created the experiment.  So, please if you have a moment, take a look and tell me what you think.

(I added code to strip the file extension because that is the use case in my application, but removing that makes little difference.)

 

thanks,

 

-John

get class name speed test.vi

 

ps. If you are wondering, I am using this in a logging operation of message system, so improving speed is important since every single message sent will cause this code to execute.

Link to comment

I think your speed test is a little flawed.  You shouldn't be updating any UI indicators in states that you want to know how long it takes to execute, because these operations like updating the UI happen asynchronously and can effect the time a state takes to execute in an unpredictable way.  I would also recommend removing debugging, and automatic error handling.  That being said I still saw a large improvement using the example class you had.  I don't have any other classes to test it with at the moment.

  • Like 1
Link to comment

It's real. It's very real.

Long story short, the need to have this Max optimized reared it's ugly head for some development happening in the ivory tower and this is the lovely precipitate.

This will greatly help the speed future versions of the AQ Lineator deserialization process.

 

So although I don't have the specific data on it, yes, this should be crazy faster.

 

~,~

  • Like 1
Link to comment

Don't know if this is so much a speed improvement so much as a first implementation. Several of us have been wishing for an efficient way of retrieving the qname of an object's class at run-time, along with a way of getting a default value from a qname. These native implementations make roll-your-own serialization methods way faster. No doubt the hacks AQ had to put in place for his framework led to this, and I for one am very glad to see this bit of functionality-- it was one of the glaring omissions in LVOOP up until now in my opinion.

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.