Slowdown with blocks deforming Geometry

mjcgmjcg Posts: 41

Hello!

I've been trying Blocks for the first time today, it looks fantastic and it will definitely change the way i use Fabric, but i came across a slowdown issue while testing it.

I've tried to recreate my simple DFG Wrap Deformer that i was previously using ( no KL ).
Now with the same setup using Blocks, it seems to be around 40x slower.

I've prepared a graph to compare my old full DFG Wrap Deformer and the new one using Blocks.

Am I doing anything wrong ?

Thanks,
Maxime.

Maxime Jeanmougin

Comments

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Moin, Maxime,

    I haven't made my way through the complete graph, but one thing I can see right away is that the "classic deformer" uses (or at least allows to use) PEX routines. The Blocks version does not. So if the geometry is detailed enough to switch to PEX (parallel processing), you may get a performance boost there, which is currently not available in Blocks.

    It might also be that the "manual" wrapping in the Blocks version isn't as optimized as the (probably internally caching) classic version that uses core functions of Fabric, but judging that would require some step-by-step time taking ...

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • mjcgmjcg Posts: 41

    Hi Marc,

    Thank you for your answer!
    The old wrap deformer does not use a PEX operator, as i mentioned there is no KL involved in this preset. Unless i missed something, I think previously PEX was only available though KL coding. That said i used to have a KL version of this wrap using PEX, and the performance differences were not as important as they are now, using the same geometry for testing.

    The DFG wrap uses only 12 of my 24 Threads, and the CPU usage barely reach 10% (runs at 60fps)
    while the Blocks one uses 13 Threads and reach 40% of CPU usage (runs at 1-2 fps)

    You might have a point about the internal caching system not being optimized, that said looking at the new Blocks samples, it seems to handle heavy Geometry without problems, so it makes me questions if there is anything in my setup that should not be done in this way using Blocks.

    Thanks,
    Maxime.

    Maxime Jeanmougin

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hi,

    I only looked at a few nodes you used and they did use PEX (depending on the count of points being used) ... some presets that come with Fabric/Canvas are prepared to use PEX so when "recreating" their functionality without parallelizing, you get slower performance.

    Also I can imagine that creating a loop function "manually" creates quite some overhead compared to an "embedded" one, but that is not to say that Blocks have to be considerably slower. I guess one would have to take time on individual nodes to find the culprit ...

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • mjcgmjcg Posts: 41

    I see, i did not pay attention to the code inside the factory nodes, It sounds a bit more logic now, thanks for your explanation Marc.

    Maxime

    Maxime Jeanmougin

  • borjaborja Administrator, Fabric Employee Posts: 480 admin

    Hi Maxime. Thanks for sharing your graph! I couldn't take a look at it yet but it is normal to expect blocks to be a bit slower with respect to using KL directly (40x slower sounds too much, though). We are already working improving the code generation of KL from blocks (with 30-50% reduction in KL code size) and also on how we cache output ports and invalidate caches. We are working on PEX support as well, so you can expect big improvements in speed in next releases.

    Borja Morales
    Technical Product Manager
    Fabric Software Inc.

  • mjcgmjcg Posts: 41

    Hi Borja, thanks for these explanations! I can't wait to see where this is going, so far Blocks is amazing, I've been waiting it for so long and it definitely reaches my expectations :)

    Now, yes, 40x slowdown is definitely strange compared to the good performance there is in the sample files, so i would be really thankful if you can get the chance to have a look at the graph to be able to get some feedback.

    Regards,
    Maxime

    Maxime Jeanmougin

  • pzionpzion Moderator, Fabric Employee Posts: 118 Fabric Employee

    Hi Maxime,

    Just to echo what the others have mentioned: blocks doesn't support PEX yet, but it's been designed to allow us to add support fairly easily, so hopefully that will come soon. We're also aware of slowdowns vs. manual KL code, and while we're never going to be able to get rid of this completely, we already have a branch where we've been working on this and seen large improvements; hopefully we will also be able to ship this soon.

    Peter Zion
    Fabric Engine

  • mjcgmjcg Posts: 41

    Thank you for the clarifications Peter.

    Maxime Jeanmougin

Sign In or Register to comment.