@@ -154,6 +154,96 @@ Measure asset method and property performance using mock interfaces:
154154 For detailed documentation on micro-benchmarks, including available benchmark files,
155155input modes, and how to add new benchmarks, see :ref: `testing_micro_benchmarks `.
156156
157+ Startup Profiling Benchmark
158+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
159+
160+ Profile the startup sequence of an IsaacLab environment using ``cProfile ``. Each
161+ startup stage is wrapped in its own profiling session and the top functions by
162+ own-time are reported. This is useful for investigating startup regressions and
163+ understanding where time is spent during initialization.
164+
165+ .. code-block :: bash
166+
167+ # Basic usage — reports top 30 functions per phase
168+ ./isaaclab.sh -p scripts/benchmarks/benchmark_startup.py \
169+ --task Isaac-Ant-v0 \
170+ --num_envs 4096 \
171+ --headless \
172+ --benchmark_backend summary
173+
174+ The script profiles five phases independently:
175+
176+ - **app_launch **: ``launch_simulation() `` context entry (Kit/USD/PhysX init)
177+ - **python_imports **: importing gymnasium, torch, isaaclab_tasks, etc.
178+ - **task_config **: ``resolve_task_config() `` (Hydra config resolution)
179+ - **env_creation **: ``gym.make() `` + ``env.reset() `` (scene creation, sim start)
180+ - **first_step **: a single ``env.step() `` call
181+
182+ Each phase records a wall-clock time plus per-function own-time and cumulative
183+ time as ``SingleMeasurement `` entries. Only IsaacLab functions and first-level
184+ calls into external libraries are included (deep internals of torch, USD, etc.
185+ are filtered out).
186+
187+ **Whitelist mode ** — For dashboard time-series comparisons across runs, use a
188+ YAML whitelist config to report a fixed set of functions instead of top-N.
189+ Patterns use ``fnmatch `` syntax (``* `` and ``? `` wildcards):
190+
191+ .. code-block :: yaml
192+
193+ # Example whitelist config
194+ app_launch :
195+ - " isaaclab.utils.configclass:_custom_post_init"
196+ - " isaaclab.sim.*:__init__"
197+ env_creation :
198+ - " isaaclab.cloner.*:usd_replicate"
199+ - " isaaclab.cloner.*:filter_collisions"
200+ - " isaaclab.scene.*:_init_scene"
201+ first_step :
202+ - " isaaclab.actuators.*:compute"
203+ - " warp.*:launch"
204+
205+ .. code-block :: bash
206+
207+ ./isaaclab.sh -p scripts/benchmarks/benchmark_startup.py \
208+ --task Isaac-Ant-v0 \
209+ --num_envs 4096 \
210+ --headless \
211+ --benchmark_backend omniperf \
212+ --whitelist_config scripts/benchmarks/startup_whitelist.yaml
213+
214+ Phases listed in the YAML use the whitelist; phases not listed fall back to
215+ ``--top_n `` (default: 5 in whitelist mode, 30 otherwise). Patterns that match
216+ no profiled function emit ``0.0 `` placeholders so the output always contains
217+ the same keys.
218+
219+ A default whitelist is provided at ``scripts/benchmarks/startup_whitelist.yaml ``.
220+
221+ .. list-table ::
222+ :header-rows: 1
223+ :widths: 25 15 60
224+
225+ * - Argument
226+ - Default
227+ - Description
228+ * - ``--task ``
229+ - required
230+ - Environment task name
231+ * - ``--num_envs ``
232+ - from config
233+ - Number of parallel environments
234+ * - ``--top_n ``
235+ - 30 (5 with whitelist)
236+ - Max functions per non-whitelisted phase
237+ * - ``--whitelist_config ``
238+ - None
239+ - Path to YAML whitelist file
240+ * - ``--benchmark_backend ``
241+ - ``omniperf ``
242+ - Output backend (``json ``, ``osmo ``, ``omniperf ``, ``summary ``)
243+ * - ``--output_path ``
244+ - ``. ``
245+ - Directory for output files
246+
157247Command Line Arguments
158248----------------------
159249
@@ -399,9 +489,12 @@ Output structure:
399489 Summary Backend
400490~~~~~~~~~~~~~~~
401491
402- Human-readable console report plus JSON file. Prints a formatted summary (runtime,
403- startup, train, frametime, and system info) to the terminal while also writing
404- the same data as JSON. Use when you want a quick readout without opening the JSON:
492+ Human-readable console report plus JSON file. Prints a formatted summary to the
493+ terminal while also writing the same data as JSON. Standard phases (runtime,
494+ startup, train, frametime, system info) are rendered with specialized formatting;
495+ any additional phases (e.g., from the startup profiling benchmark) are rendered
496+ automatically with their ``SingleMeasurement `` and ``StatisticalMeasurement ``
497+ entries. Use when you want a quick readout without opening the JSON:
405498
406499.. code-block :: bash
407500
0 commit comments