Python guide and API reference#

class isaacsim.common.profiling.InstantType(
value,
names=<not given>,
*values,
module=None,
qualname=None,
type=None,
start=1,
boundary=None,
)#

Timeline occupied by an instant event.

PROCESS = 1#
THREAD = 0#
class isaacsim.common.profiling.Zone#

Move-only ownership of one active profiling zone.

property active#

Whether the zone is active.

close#

End the profiling zone if it is active.

isaacsim.common.profiling.profile(
function: _Callable | None = None,
*,
mask: int = 0,
zone_name: str | None = None,
add_args: bool = False,
capture_source: bool = True,
) → _Callable | Callable[[_Callable], _Callable]#

Decorate a synchronous or asynchronous function with a profiling zone.

Parameters:
  • function – Function selected when the decorator is used without arguments.

  • mask – Carbonite capture-mask bits. Zero selects Carbonite’s default mask.

  • zone_name – Explicit zone name. The function name is used when omitted.

  • add_args – Whether to append positional and keyword arguments while profiling is enabled.

  • capture_source – Whether to include the Python source location.

Returns:

Decorated function or a decorator configured with the selected options.

isaacsim.common.profiling.start() → None#

Start the package-owned Carbonite NVTX profiler.

Raises:

RuntimeError – If standalone profiling is already running, another profiling host is attached, or the native host cannot start.

Example

import isaacsim.common.profiling as profiling

profiling.start()
try:
    with profiling.zone("example/work"):
        run_work()
finally:
    profiling.stop()
isaacsim.common.profiling.stop() → None#

Stop the package-owned Carbonite NVTX profiler.

This function has no effect when start() has not successfully started a session. It never detaches a profiler supplied by Kit or another application host.

Raises:

RuntimeError – If the native host cannot stop an active standalone session.

Example

profiling.start()
try:
    run_profiled_work()
finally:
    profiling.stop()
isaacsim.common.profiling.zone(
name: str | Callable[[], str],
*,
mask: int = 0,
capture_source: bool = True,
) → Zone#

Create a profiling zone for use as a context manager.

Parameters:
  • name – Stable zone name or a factory evaluated only when profiling is enabled.

  • mask – Carbonite capture-mask bits. Zero selects Carbonite’s default mask.

  • capture_source – Whether to include the Python source location.

Returns:

Active zone when a profiler admits the mask, otherwise an inactive context manager.

Raises:
  • TypeError – If the selected name is not a string.

  • ValueError – If the selected name is empty.