Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does RtlInitializeExceptionChain do, and how can I reduce its execution overhead?

Tags:

I am trying to find bottlenecks in my program (currently in the "low-hanging fruit" stage), and using a profiler I get something like the following:

Sleepy screenshot

The thing I see in this is that RtlInitializeExceptionChain takes up the far majority of the time, and functions from my actual program don't even make it onto this top list. I would like to know if anyone knows what RtlInitializeExceptionChain does, how it is called, and how I can reorganize my program to not call it so much?

Some other information about my project: it is a COM API using ATL, and the program being profiled is a "testing" C++ program which consumes this API.

Thanks!

like image 382
fyhuang Avatar asked Jul 27 '11 23:07

fyhuang


1 Answers

RtlInitializeExceptionChain is an internal function in the Run-Time Library, a collection of kernel-mode support functions used by kernel-mode drivers and the OS itself. It's kind of the kernel-mode version of the C run-time library.

If your application is 32-bit and you're profiling it on a 64-bit machine, profiling it on a 32-bit machine or building a 64-bit version will probably move RtlInitializeExceptionChain out of the top 10 list since it's always used in thunking.

Otherwise, there's almost certainly nothing you can do about it.

like image 163
Carey Gregory Avatar answered Oct 19 '22 03:10

Carey Gregory