Jump to content

Is Bind Export VOP faster to use than Add Attrib VOP?


Recommended Posts

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 :)

  • Like 1
Link to comment
Share on other sites

Guest mantragora

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 by mantragora
  • Like 1
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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.

  • Like 4
Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

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.

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