Trace Event Profiling with chrome://tracing and SPDR
Knowing more about my code has been a part-time obsession for a couple of years now both at work and outside. Can you really improve what you cannot measure or even visualize?
After some months I had settled with monitoring a certain number of variables in a HTML/Javascript page hosted inside my programs, using the mongoose http server.
However this article from August 2012 made me reconsider writing my own visualization console.
Furthermore, I value very much reusing APIs / protocols (when reusing implementations is not necessary or even needed) and so the trace event profiling API outlined there gave me the needed push to start my own implementation, whose first version I am releasing today: uu.spdr-v0.1.0
It is called SPDR, and allow you to label sections of your code, track the evolution of values with minimum overhead, and importantly in a format compatible with Google’s trace viewer, which almost every one has at their desk in the form of chrome.
The SPDR library is lightweight, compiles for Windows, OS X and POSIX platforms. It is designed to not allocate more memory than you want to use, and supports concurrent traces.
Google’s trace viewer code is also available standalone, which should make it easy to embed in your app.