I have created an application in C++ using MFC, and then one day I have executed this application using Intel VTunes just to monitor the performance of the application and to check where most of the time is consumed by my application. After analyzing I have found that about 40% of the time is consumed by my code and around 35% of the time is consumed by the ntdll.dll file. So, the point here I wants to know is that is this a normal behaviour. I mean is this consumption i.e. 35% of the total time justifiable. Can anyone tell me that which kind of responsibilities resides on ntdll.dll i.e which kind of functionalities is achieved through this dll file, so that I can sort things out in my case and be able to optimize the code.
ntdll contains the NT kernel functions. download the right ntdll pdb from microsoft and you should be able to see the kernel functions your app is using. that will give you a starting point. the kernel percentage seems to be high in your caseand you'll need toexplain us in more details what your app is doing.
Actually ntdll.dll was working in your application's process - functions in ntdll.dll was called by your code (or in runtime libraries). You may use Call Graph feature in VTune Performance Analyzer to know function's calling sequence.
With version 9.1 of the VTune analyzer for Windows, you can set the following environment variable to have the VTune analyzer automatically download the correct symbol file for a system DLL:
See http://www.microsoft.com/whdc/DevTools/Debugging/debugstart.mspx for a discussion of the Microsoft* symbol server.