vsix - template_profiler extension

Hello, I've put together a Visual Studio 2010 extension package which wraps the functionality of Steven Watanabe and Domagoj Saric's template_profiler to create a template profile tool. It also adds a command to profile the build time of a project or a single C++ file. Both functions are accessed from the context menu in the solution explorer tree-view. It's still fairly young and could use some kicking about. Are there any VC10 users here that would be interested in giving it a try? Cheers, Brandon

On 9/30/2011 4:12 PM, Christian Holmquist wrote:
Sure thing. Is it available for download somewhere?
Yeah, here's a link on github: https://github.com/brandon-kohn/Meta/blob/master/Meta.vsix Cheers, B

On 9/30/2011 1:56 PM, Brandon Kohn wrote:
On 9/30/2011 4:12 PM, Christian Holmquist wrote:
Sure thing. Is it available for download somewhere?
Yeah, here's a link on github:
I would love a plug-in like this. Unfortunately, I can't get the Meta.sln solution to open. It chokes on Meta\Meta.csproj with the error: The project file 'C:\boost\org\Meta\Meta\Meta.csproj' cannot be opened. The project type is not supported by the installation. Note: I do have C# installed on this machine, so that's not the problem. -- Eric Niebler BoostPro Computing http://www.boostpro.com

On 9/30/2011 6:56 PM, Eric Niebler wrote:
I would love a plug-in like this. Unfortunately, I can't get the Meta.sln solution to open. It chokes on Meta\Meta.csproj with the error:
The project file 'C:\boost\org\Meta\Meta\Meta.csproj' cannot be opened. The project type is not supported by the installation.
Maybe it requires you to have the visual studio sdk installed? http://www.microsoft.com/download/en/details.aspx?id=21835 Try that and let me know if it helps. You might also try installing that Meta.vsix file. It's a pre-build extension ready to install. Cheers, Brandon

On 9/30/2011 5:14 PM, Brandon Kohn wrote:
On 9/30/2011 6:56 PM, Eric Niebler wrote:
I would love a plug-in like this. Unfortunately, I can't get the Meta.sln solution to open. It chokes on Meta\Meta.csproj with the error:
The project file 'C:\boost\org\Meta\Meta\Meta.csproj' cannot be opened. The project type is not supported by the installation.
Maybe it requires you to have the visual studio sdk installed?
http://www.microsoft.com/download/en/details.aspx?id=21835
Try that and let me know if it helps.
Yes, that helped. I haven't tried to use it yet, but I can at least open the solution.
You might also try installing that Meta.vsix file. It's a pre-build extension ready to install.
Oh, ok. Thx. -- Eric Niebler BoostPro Computing http://www.boostpro.com

On 30/09/2011 17:56, Brandon Kohn wrote:
On 9/30/2011 4:12 PM, Christian Holmquist wrote:
Sure thing. Is it available for download somewhere?
Yeah, here's a link on github:
--------------------------- Microsoft Visual Studio --------------------------- Exception of type 'System.OutOfMemoryException' was thrown. --------------------------- Immediately after "Profile Templates Instantiation" on a .cpp, with plenty of memory available (in fact there are no noticeable allocations before that error). Am I missing anything? Agustín K-ballo Bergé.- http://talesofcpp.blogspot.com

On 9/30/2011 11:21 PM, Agustín K-ballo Bergé wrote:
Exception of type 'System.OutOfMemoryException' was thrown. ---------------------------
Immediately after "Profile Templates Instantiation" on a .cpp, with plenty of memory available (in fact there are no noticeable allocations before that error). Am I missing anything?
Interesting :). I'll try to catch some exceptions in the unmanaged portion of the code to try and see exactly where in the process it happens. Is that message what shows up in the Profile Build output window? Here's what is typically shown in the output: Profiling Instantiations on preprocess.cpp: Instrumenting Code... Running Profile... Finalizing Data... Total instantiations: 1266 ... Do you happen to see any of those phases above being run? B

Hi Agustín, I'm trying to think what could be wrong on your setup. Are you able to run the other command 'Profile Build Time' on that cpp file? Does the problem happen with any cpp file you try? Also, what are the specs of the pc on which you are running this? If the other command works and it is only the template instantiation one that fails, perhaps it's an issue with the initialization of the thread used by the template profiler. I have it set to reserve a 500MB stack size to avoid stack overflow issues with the xpressive regex's that instrument the code. Perhaps that reservation is killing it in your case. I plan to make that stack size configurable. I just have to figure out how that works in the VS extension framework. B

I've added a persistent options page to the VS Tools Menu: Tools->Meta. There the stack size can be changed if anyone runs into problems. Changes and new Meta.vsix are up at the github. https://github.com/brandon-kohn/Meta Cheers, Brandon

I should also add that you can double click on the call graph outputs to go to the specified file locations. :) B

On 30.9.2011. 21:56, Brandon Kohn wrote:
Hello,
I've put together a Visual Studio 2010 extension package which wraps the functionality of Steven Watanabe and Domagoj Saric's template_profiler to create a template profile tool. It also adds a command to profile the build time of a project or a single C++ file. Both functions are accessed from the context menu in the solution explorer tree-view. It's still fairly young and could use some kicking about. Are there any VC10 users here that would be interested in giving it a try?
Hi, instead of that approach (probably the easiest way to use profile_templates2 is through a CMake project) you might want to try the Templight route. A couple of years back the Hungarian team behind it tried to do the same thing as you (a "meta program debugger and profiler" Visual Studio add-in, only it was written in C++ rather than in C#). The source for an alpha-ish version was also available somewhere on the web but I can't find it anywhere now, only the following info: http://gsd.web.elte.hu/templight http://gsd.web.elte.hu/templight/ECOOP_Templight_Poster.pdf http://gsd.web.elte.hu/contents/articles/gpce06.pdf http://aszt.inf.elte.hu/~gsd/s/cikkek/abel/comptime.pdf http://aszt.inf.elte.hu/~gsd/s/cikkek/abel/tmpcefp.pdf http://aszt.inf.elte.hu/~gsd/s/cikkek/profiling/profile.pdf http://patakino.web.elte.hu/ICAI_Poster.pdf I might still have their source somewhere on disk so I could upload it somewhere if you want (if there are no licencing issues of course)... -- "What Huxley teaches is that in the age of advanced technology, spiritual devastation is more likely to come from an enemy with a smiling face than from one whose countenance exudes suspicion and hate." Neil Postman

On 9/30/2011 12:56 PM, Brandon Kohn wrote:
Hello,
I've put together a Visual Studio 2010 extension package which wraps the functionality of Steven Watanabe and Domagoj Saric's template_profiler to create a template profile tool. It also adds a command to profile the build time of a project or a single C++ file. Both functions are accessed from the context menu in the solution explorer tree-view. It's still fairly young and could use some kicking about. Are there any VC10 users here that would be interested in giving it a try?
Hi Brandon, I finally got around to trying out your template profiler. Looks good, but I'm having trouble using the output. I get: Profiling Instantiations on main.cpp: Instrumenting Code... Running Profile... Finalizing Data... Total instantiations: 2894 Call Graph Location : (count / cum.) ------------------------------------------------------------------------ c:\boost\org\trunk\libs\proto\scratch\main.cpp(37) : (1) Parents: Children: c:\boost\org\trunk\boost\fusion\support\is_segmented.hpp(22) : (1/1) c:\boost\org\trunk\boost\fusion\support\is_segmented.hpp(26) : (1/2) c:\boost\org\trunk\boost\fusion\support\is_segmented.hpp(46) : (1/2) <...much more snipped...> I expected to see the names of templates, ordered by which were instantiated the most frequently. Is there a way to get that output? -- Eric Niebler BoostPro Computing http://www.boostpro.com

On 2/26/2012 2:48 PM, Eric Niebler wrote:
I expected to see the names of templates, ordered by which were instantiated the most frequently. Is there a way to get that output?
At the moment the code only stores the filename and line number. I'll have a look at having it open the files and pull information out of the line to add more context. Cheers, Brandon

On 2/27/2012 9:22 AM, Brandon Kohn wrote:
On 2/26/2012 2:48 PM, Eric Niebler wrote:
I expected to see the names of templates, ordered by which were instantiated the most frequently. Is there a way to get that output?
At the moment the code only stores the filename and line number. I'll have a look at having it open the files and pull information out of the line to add more context.
Oh and BTW, you can double click on the items in that call graph to see the location. Cheers, Brandon
participants (5)
-
Agustín K-ballo Bergé
-
Brandon Kohn
-
Christian Holmquist
-
Domagoj Saric
-
Eric Niebler