modin-project / modin

Modin: Scale your Pandas workflows by changing a single line of code
http://modin.readthedocs.io
Apache License 2.0
9.91k stars 653 forks source link

Using decorators makes the profile confusing with a lot of circular dependencies. #7267

Open anmyachev opened 6 months ago

anmyachev commented 6 months ago

For example:

image

The situation can be improved with the help of the following workaround proposed here:

traceable_name  = f"wrapped_fn_{fn.__name__}"
wrapped_fn.__name__ = traceable_name ### PATCH - better profiling resolution
wrapped_fn.__code__ = wrapped_fn.__code__.replace(co_name=traceable_name)

With these changes (applied for run_and_log function) the graph will look something like this:

image