ANTS not including timings when calling COM objects
webview
Posts: 11
I am using ANTS 2.0 to profile a .NET application that makes calls into COM methods (for Microsoft Word). Obviously I don't expect ANTS to be able to tell me the times for what is going on once it crosses over into COM, but for some reason it doesn't accurately report how long the .NET methods that make the COM calls take to execute.
For example:
MyFunc() calls (through COM interop) a Word function that takes 10 secs to execute.
ANTS reports that MyFunc took like 0.002 seconds to execute. It looks like this time is from the method entry point to the time it crosses the COM interop code, when in reality, it should tell me how long MyFunc() took to run (from entry to exit).
Is there possibly a setting I can enable where ANTS will tell me the total elapsed time the function takes to execute regardless of what is being called inside the .NET method?
For example:
MyFunc() calls (through COM interop) a Word function that takes 10 secs to execute.
ANTS reports that MyFunc took like 0.002 seconds to execute. It looks like this time is from the method entry point to the time it crosses the COM interop code, when in reality, it should tell me how long MyFunc() took to run (from entry to exit).
Is there possibly a setting I can enable where ANTS will tell me the total elapsed time the function takes to execute regardless of what is being called inside the .NET method?
Comments
I have a suspicion that this has something to do with the threading model of the COM component that you had called. Like the method that you had called in the COM object had kicked off a thread and returned a result back to the Interop dll right away. Could that be the case?
Should ANTS handle profiling COM interop (or any interop) for that matter?
we have fixed the timings for COM libraries in v2.1 of the product. If you are interested in having a look at the beta of v2.1 just send a quick mail to support@red-gate.com
Thanks,
Tom Harris
Red Gate Software Ltd
Well - I use version 2.6.0 build 62
and I still get a very long time profiling a .NET application using a Word.Interop.
About 10 sec. each time - and without Ants using my own custom made loggning this takes under 1 sec!
Any ideas?
Below is listet the code which take approx. 10 sec. to profile.
(I'm using Interop.Word.dll verison 8.1.0.0 and
Interop.Office.dll version 2.1.0.0)
mWordApp = new Application();
mWordApp.Visible = false;
mWordApp.Options.CheckSpellingAsYouType = false;
mWordApp.Options.CheckGrammarWithSpelling = false;
mWordApp.Options.CheckGrammarAsYouType = false;
mWordApp.Options.CheckHangulEndings = false;
best regards Bo.