SOP: Standard vs Custom attributes speeds

I wanted to pack the data from the OpticalFlow component into a SOP attribute, which then I can use for instancing. At first i was packing it into a custom attribute i created called flowData and was getting around 10-11ms cook times for that Point SOP. That made my project run at around 36fps. I used this python expression to do the packing:

me.inputPoint2.flowData[0]

I then decided to try just packing it into the Color attribute, since i wasn’t currently using it for anything and then i got 7-8ms cook times, which brought my project up to around 44fps. I used this python expression:

me.inputColor2[0]

Is there a reason the custom attributes are slower than the standard ones?

Also avoiding SOP instancing / data packing into attributes, and sticking to instancing from CHOPs, i could easily get 60fps again.

This was all tested on my 2013 Macbook Pro. I’ve add my project file if other people wanted to test it. There’s two buttons in Perform mode to switch between a) CHOP and SOP instancing, and b) Color vs Custom attributes.
wallExtruder.toe (10.9 KB)

This example shows an error on the Point SOP where you try to set the custom attrib using me.inputPoint2.flowData[0], because flowData doesn’t exist.

click the button in perform mode to switch between Cd attributes and Custom attribs.

i’m trying to be clever with the Chopto SOP before the two Point SOPs, check it out. It increases the fps when i do it this way. I’m sure there’s a better way to do it with the same result and no error sign, but i assure you, nothing is broken and everything exists :smiley:

I"m afraid I don’t have a good answer as to “why” that difference exists in your example, though I don’t know if it’s a true like-to-like comparison.

I’ve modified your example to use a CHOP to SOP where one approach overwrites an existing color attribute - Cd(0) - and the other creates a new attribute - flowData. Both of these use the same operator to create a comparison in speed based on creating a new attribute vs. overwriting an existing one.

Looking at their average cooktimes are close with a delta of about 0.006 - 0.009ms over a 4 second window. This change looks like it’s close to comparable to your CHOP only approach in overall cooktime.

That does seem to indicate that there’s a fairly negligible difference between using existing attributes vs. creating custom attributes. I don’t know if that helps clarify your concern, or just raises more questions - but is at least interesting.
wallExtruder-like-to-like.toe (10.8 KB)

Oh wow! I built this project in so many iterations, it always had the Point SOP but varied on how it packed data into the attribute. I added the Chopto SOP later on, and didn’t realize that once i did that, Point SOP was pretty much redundant at that point and could be ditched. Thanks for getting my SOP pipeline up to 60fps.

And interestingly enough, in your example, the Custom attribute method has a faster cook time, but you’re right, it’s pretty negligible at this point.

If it’s not a standard vs custom attrib issue, but rather a create vs. overwrite issue, i think that’s still pretty interesting as well and something to note.

Anyways, i’m not sure if i’m onto anything life changing, just something i noticed while trying to use SOP instancing more in my workflow, because why? boredom, probably.