Add compiler timing diagnostics to mjsCompiler, printed by compile.cc
For example, `compile mujoco_menagerie/robotis_op3/scene.xml` now outputs
```
Compile 1 (cold cache):
total: 317.2 ms
assets: 284.8 ms (wall clock)
load: 616.1 ms
hull: 26.4 ms
poly: 137.8 ms
inert: 177.8 ms
bvh: 568.2 ms
octr: 1.6 ms
tex: 25.3 ms
other: 32.4 ms
Compile 2 (warm cache):
total: 79.9 ms
assets: 54.5 ms (wall clock)
load: 888.5 ms
hull: 0.0 ms
poly: 0.0 ms
inert: 0.0 ms
bvh: 0.0 ms
octr: 0.0 ms
tex: 21.4 ms
other: 25.3 ms
```
PiperOrigin-RevId: 917850214
Change-Id: Iaec86230bec0faf2e47820e20cbff61de5b2621e
This commit is contained in:
committed by
Copybara-Service
parent
f712eed4ce
commit
bdf00966f9
@@ -1965,6 +1965,22 @@ typedef enum mjtOrientation_ { // type of orientation specifier
|
||||
mjORIENTATION_ZAXIS, // z axis (minimal rotation)
|
||||
mjORIENTATION_EULER, // Euler angles
|
||||
} mjtOrientation;
|
||||
typedef enum mjtCTimer_ { // compiler timing categories
|
||||
// top-level timers (wall-clock)
|
||||
mjCTIMER_TOTAL = 0, // total compile time
|
||||
mjCTIMER_ASSETS, // asset compilation
|
||||
|
||||
// asset sub-timers (CPU time, summed across all assets)
|
||||
mjCTIMER_TEXTURE, // textures
|
||||
mjCTIMER_MESH_LOAD, // mesh: file loading
|
||||
mjCTIMER_MESH_HULL, // mesh: convex hull
|
||||
mjCTIMER_MESH_POLYGON, // mesh: normals and polygons
|
||||
mjCTIMER_MESH_INERTIA, // mesh: volume, CoM, inertia
|
||||
mjCTIMER_MESH_BVH, // mesh: bounding volume hierarchy
|
||||
mjCTIMER_MESH_OCTREE, // mesh: octree and SDF
|
||||
|
||||
mjNCTIMER // number of compiler timers
|
||||
} mjtCTimer;
|
||||
typedef struct mjsElement_ { // element type, do not modify
|
||||
mjtObj elemtype; // element type
|
||||
uint64_t signature; // compilation signature
|
||||
@@ -3471,6 +3487,7 @@ void mju_free(void* ptr);
|
||||
void mj_warning(mjData* d, int warning, int info);
|
||||
void mju_writeLog(const char* type, const char* msg);
|
||||
const char* mjs_getError(mjSpec* s);
|
||||
const double* mjs_getTimer(mjSpec* s);
|
||||
int mjs_isWarning(mjSpec* s);
|
||||
void mju_zero3(mjtNum res[3]);
|
||||
void mju_copy3(mjtNum res[3], const mjtNum data[3]);
|
||||
|
||||
Reference in New Issue
Block a user