Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dead-End: Very slow exception handling #11

Open
wants to merge 1 commit into
base: reope/performance-base
Choose a base branch
from

Conversation

dimven-adsk
Copy link
Owner

@dimven-adsk dimven-adsk commented Sep 27, 2024

building as release and running in that mode, we completely get rid of the exception cost:
image

superseded details

I am trying to figure out why running a very basic python node that just returns all categories runs incredibly slow:

WMywTslvNU

This is the content of the node - it is extremely simple and only calls the Dynamo category wrapper about a thousand times:
DynamoSandbox_PfvX9uHUnJ

Initially I incorrectly assumed that I can just add a "bad category ids list" and improve the performance on consecutive runs. That however made zero difference to the overall performance (before vs after):

devenv_a5L0MtpViu

devenv_wDu3Snl4xG

devenv_K2waw3kmwF

It still took over 13 seconds to run this single node. I then looked at the flame graph and realized that the extra 13 seconds of computing come purely from throwing the exceptions (look at the lines throwing the exceptions):

devenv_Qd2rRxx88e

devenv_L3yTRmfZkS

If we don't throw exceptions and just return nulls, that completely negates the slowdown:

yfh6lYJWQ4

Now, clearly we don't want to do that, because it breaks the overall functionality. But what can we do to avoid the cost? I know that exceptions are slow but they should not be this slow. Is the problem in the underlying Dynamo core VM or is it somewhere else? Do you have any further observations on this?

@dimven-adsk dimven-adsk changed the title WIP: Very slow exception handling Deadend: Very slow exception handling Oct 3, 2024
@dimven-adsk dimven-adsk changed the title Deadend: Very slow exception handling Dead-End: Very slow exception handling Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant