Profiler for Xpand/Xtend/Check

A polished version of the announced profiler will be part of the upcoming 0.8.0 M2 release of Xpand next Tuesday. It acts as a callback for any expression-based workflow component to measure the execution times of Xpand templates, Xtend functions and Check validations. Also, it constructs a call-graph model to introspect callers and callees and their corresponding call times. From this model you can then generate an HTML report as part of your generator workflow.

Output of the profiler from the Xpand Sample-Project

Output of the profiler from the Xpand Sample-Project

If you stay with the text-based GProf output format (another option to dump the collected data) you can also use tools like Gprof2Dot to visualize hot spots with colors and callees as painted connections.

Same workflow visualized with Gprof2Dot without reduction of nodes with no impact

Same workflow visualized with Gprof2Dot without reduction of nodes with no impact

The updated documentation explains how you can integrate the profiler into your workflow. Also, the Xpand Sample-Project Wizard creates a second workflow “generatorWithProfiler.mwe” where I have generated the above results from.

In a real-world project we were able to reduce the execution time of a workflow that originally took nearly half an hour down to less than 3 minutes using an earlier version of this profiler. It can also help you detecting unwanted indirections and recursions.

Support my Work

Writing an article like the one you have just read takes me quite an amount of my personal time. Way too often, I invest this time in different interests and decide against another blog post. On the other hand, you can motivate me with your feedback, your thoughts and your ideas. Please leave a comment below or flattr this post if you think it's worth it.

Comments

  1. This is really cool! However, my performance bottleneck with Xpand/Xtend/Check is not the execution of the language but the refresh resources of the entire workspace that the workflow does automatically. I have a huge workspace with > 30,000 files and it takes up to 10 minutes to refresh the entire workspace (if the windows file cache is empty). And even if everything is in the cache it takes 15 seconds.

    I have 5 related languages. If I change the ‘base language’ I have to run 5 workflows which takes between 3 min and 12 min (including stating the workflow, refresh and building the workspace). Only about 40 – 50 seconds are really xtext/xpand/check execution time.

    Michael

    Michael

  2. [...] execution performance of your generator, the new Xpand profiler comes in handy. Heiko already blogged about it. There’s also documentation available.MWE (fixed bugzillas)For MWE only some bugs were fixed. The [...]

Leave a Reply