magneto Posted May 23, 2013 Share Posted May 23, 2013 Hi, I was watching SESI's Flora 1 by Ari, where he says several times that Bind and Bind Export VOPs are much faster than Import Attrib VOP and Add Attrib VOP. Is this true? I tried it for adding attributes, but it was 2x slower. I also tried for importing attributes and that seemed like 10ms slower than Import Attrib VOP for 2M points. The Bind VOP help card also has no mention of performance. Is this SESI insider knowledge? I know this difference is negligible but if the statement is true, I would like to know this. Here is the video: Thanks 1 Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted May 23, 2013 Share Posted May 23, 2013 (edited) I don't know the code behind each operator method but there are three methods of handling attribute in HDK. As Graham pointed out here, his code is/should be three times faster than mine. Also document that you can find in $HFS\toolkit\slides\HDK12_Intro.pdf page 33 and forward states the same and it looks that indeed Grahams version should be faster.That's theory. Reality is, my version of the code is faster in every test I made. At least on Windows. Why? I don't know. Maybe compiler difference or maybe more air humidity, only SESI knows. The same may be here. If we could peek inside what code each operator is using we could better guess which way we will get better perfomance. Maybe Bind method uses PageHandle and that's why it should be faster? (But this is not always true, like in my code). Edited May 23, 2013 by mantragora 1 Quote Link to comment Share on other sites More sharing options...
anim Posted May 23, 2013 Share Posted May 23, 2013 I didn't notice any speed difference Import Attribute VOP, Bind VOP and Parameter VOP are equaly as fast in my tests to get the attribute values on millions of points and Add Attribute VOP, Bind VOP and Parameter VOP are equaly as fast to export the attribute values as well and that is the logical thing, since they are higher level tools, so internally in perfect world the most efficient algorithm should be used for all of them when used to do the same thing the new Bind VOP is essentially Parameter VOP with stripped off UI widget functionality (and according to help be used even in compiled subnetworks) so at least it is as fast as Parameter VOP 1 Quote Link to comment Share on other sites More sharing options...
old school Posted May 23, 2013 Share Posted May 23, 2013 The Import Attribute VOP and Add Attribute VOP are slightly less efficient than using Bind VOPs to fetch and write attributes. The Import Attribute VOPs need to account for all four inputs and from what I understand this is where the slight overhead may come from. Bind VOPs are intended to pick up the first input attribute data only. The Bind VOP was introduced in H12.5 to support the pre-compliation of VOP HDA's (with the Save Cached Code option on in the Type Properties). You can't have Parameter VOPs in HDA's with this pre-compliation toggle enabled for inheriting attributes inside your VOP HDA so you use the Bind VOPs instead as they do support this option. It is preferred that for directness and future-safing files that if you are strictly inheriting attributes from the first input, use the Bind VOP in place of the Parameter VOP. As for Import Attribute VOP, use it if you are picking up attributes from the other inputs. Or do what you want. 4 Quote Link to comment Share on other sites More sharing options...
magneto Posted May 23, 2013 Author Share Posted May 23, 2013 Thanks alot guys. @oldschool: Thanks for the insider info. I will use Bind VOP the way you explained. Always better to use the most optimal, updated ways IMO. Quote Link to comment Share on other sites More sharing options...
old school Posted May 23, 2013 Share Posted May 23, 2013 Oh one more thing, if the name of the attribute you are fetching is dynamic, the Import Attribute VOP or Get Attribute VOP is preferred over the Bind VOP. It allows you to specify a string parameter as the name of the attribute along with the input. The Bind VOP will hardocde the name of the attribute in to the compiled vex code. Remember that the Import Attribute VOP is only available in the SOP context (VOP SOP) and not any other contexts including the Volume VOP SOP. 2 Quote Link to comment Share on other sites More sharing options...
magneto Posted May 23, 2013 Author Share Posted May 23, 2013 Thanks oldschool, great info all around Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.