Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Which is faster? For_each and a "do_while" or just a "do_while"?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
mcw0
414 Views, 5 Replies

Which is faster? For_each and a "do_while" or just a "do_while"?

Is it faster to feed all the points of a mesh into a "do_while" node, or to use a "for_each" (since it's in parallel) and feed that into a "do_while" node?

5 REPLIES 5
Message 2 of 6
mjcg91
in reply to: mcw0

That's hard to tell without knowing what your graph is actually doing. Is your do-while inside the for-each ? If that is the case it might be the faster way.

 

If you want to monitor performances, I wrote a blog post about how to profile things a while ago. You can use this method and find out by yourself: https://maximejeanmougin.com/2020/07/28/profiling-in-bifrost/ 

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 3 of 6
mcw0
in reply to: mjcg91

Hi Maxime,

 

With your help, I created my own raycaster.  2.0.5.1 doesn't have one.  And I was just feeding it all the mesh points and having it raycast each one.  And then I thought...what if I use the for_each.  And inside of the for_each, I do my raycasting.  That way, all the points will be handled at the same time.  I wasn't sure if the do_while node handled points like the iterator node.

 

But thank you for the link.  I'll definitely check it out.

Message 4 of 6
mcw0
in reply to: mcw0

AGH...we only have 2.0.5.1 currently.  Our studio is pretty slow in addressing update requests.  So the Rebel Pack won't work.  No dielectric_ray_visualizer.  😞

Message 5 of 6
mjcg91
in reply to: mcw0

do-while is iterative so it will not compute each iteration in parallel. It's main purpose it to break loop on condition, and can also return last iteration values values. You could use it like a for-each, but do-while doesn't have iteration target for inputs and outputs, to you have to manually use get_in_array / set_in_array using the current_index counter.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 6 of 6
mcw0
in reply to: mjcg91

AWESOME!  That's what I wanted to know.  Again, thank you Maxime.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report