The probe system is a simple tracking tool to help you locate high-level performance problems. It can be found in the cm.track.probe package.
Usage
Probes, both active and inactive, are tracked during runtime. You can get a runtime list of the available probes:
listExistingProbes();
9 existing probes buildSym createSym execSymProg symToRedInfo symToRedOptimized symTryCopyRoot symValidate triangulateGeometry2D zstretch
You can activate probes individually:
initProbe("symToRedInfo"); initProbe("symValidate"); initProbe("buildSym");
or activate everything:
initAllProbes();
After the probes are active they will start tracking time. To get a report you execute:
probeReport();
probe time min time max time time/call calls createSym 183 ms 297 us 2 us 113 ms 711 us 1 ms 490 us 123 buildSym 181 ms 512 us 0 us 113 ms 639 us 1 ms 475 us 123
symValidate 122 ms 233 us 33 ms 50 us 89 ms 182 us 61 ms 116 us 2 execSymProg 116 ms 274 us 8 us 61 ms 728 us 894 us 130 zstretch 55 ms 507 us 8 us 3 ms 166 us 584 us 95 symToRedInfo 156 ms 995 us 0 us 61 ms 777 us 654 us 240 symTryCopyRoot 108 ms 901 us 0 us 61 ms 763 us 463 us 235 symToRedOptimized 34 ms 904 us 8 us 8 ms 553 us 3 ms 173 us 11 triangulateGeometry2D 143 us 34 us 71 us 47 us 3 symValidate 9 ms 580 us 0 us 9 ms 418 us 39 us 240 execSymProg 6 ms 395 us 22 us 1 ms 614 us 426 us 15 zstretch 6 ms 65 us 13 us 1 ms 573 us 505 us 12 symValidate 2 ms 473 us 0 us 2 ms 201 us 7 us 350 execSymProg 1 ms 586 us 149 us 346 us 264 us 6 zstretch 1 ms 524 us 141 us 338 us 254 us 6
If you're not interested in the hierarchy you can get a flat report with:
probeReport(tree=false);
probe time min time max time time/call calls createSym 183 ms 297 us 2 us 113 ms 711 us 1 ms 490 us 123 buildSym 181 ms 512 us 0 us 113 ms 639 us 1 ms 475 us 123 symToRedInfo 156 ms 995 us 0 us 61 ms 777 us 654 us 240 symValidate 134 ms 286 us 0 us 2 ms 201 us 226 us 592 execSymProg 124 ms 255 us 149 us 346 us 822 us 151 symTryCopyRoot 108 ms 901 us 0 us 61 ms 763 us 463 us 235 zstretch 63 ms 98 us 141 us 338 us 558 us 113 symToRedOptimized 34 ms 904 us 8 us 8 ms 553 us 3 ms 173 us 11 triangulateGeometry2D 143 us 34 us 71 us 47 us 3
Setup Probes
Probes can be added around known hot-spots or performance-sensitive code using the StartProbe/stopProbe functions or the probe syntax. For example:
package REDShape toRedOptimized(REDSymGfxEnv env) { startProbe("symToRedOptimized"); ... stopProbe("symToRedOptimized"); return res; } }
or:
package REDShape toRedOptimized(REDSymGfxEnv env) { probe("symToRedOptimized") { return ...; } }
Comments
0 comments
Please sign in to leave a comment.