deephaven / deephaven-plugins

Deephaven Plugins
11 stars 14 forks source link

Render time debug logging #405

Open mattrunyon opened 5 months ago

mattrunyon commented 5 months ago

As a user, I want a way to enable logging of render times so that I can determine which components to target first for optimization.

We should either add an optional param to @ui.component that enables printing the timing of the render calls for that component (and its children?) or a flag/function in the package that enables this for every component until disabled. This might be the easiest for more complex UIs

mofojed commented 5 months ago

You can enable debug logging in Python (see logging instructions):

import logging
import sys

# Have the root logger output to stdout instead of stderr
logging.basicConfig(stream=sys.stdout, level=logging.WARNING)

# Set the log level for the deephaven.ui logger to DEBUG
logging.getLogger("deephaven.ui").setLevel(level=logging.DEBUG)

You can then check the timestamps in the Log panel to see how long the render took.

That being said, it would be nice to have an explicit "Render took Xms" log line at the end of the render.