profiling
profiling_end(pr: Optional[cProfile.Profile], identifier: str)
¶
Stop profiling and save results with timestamp.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pr
|
Optional[Profile]
|
Profile object from profiling_start, or None. |
required |
identifier
|
str
|
Identifier for the profiling session (e.g., "solve", "initialize"). |
required |
Source code in openscvx/utils/profiling.py
profiling_start(profiling_enabled: bool) -> Optional[cProfile.Profile]
¶
Start profiling if enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profiling_enabled
|
bool
|
Whether to enable profiling. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Profile]
|
Profile object if enabled, None otherwise. |