Hi,
We have a project to rewritte code of our Win2K Drivers (written in C)for
PCI card to WDM Drivers using DriverWorks. A lot of code has been reused.
Only the front end is big different. The old one is in C and the new one
in C++ using DriverWorks template. The project is half completed.
Now we experienced a big drop of performance (4-5 times slower) in new
Drivers versus the old one.
To narrow down the problem. I’ve tried to compare the time it takes to
process a IOCTL in both drivers.
I used DriverWorks wizard to created a new sample WDM driver for PCI card
(do not have any of my old driver code)
I used the following sample code in an application to calculate the time
it takes to process one dummy IOCTL ( When receive the request from Kernel
driver, the Irp is completed right away without doing anything )
QueryPerformanceCounter(&Before);
DeviceIoControl( hDriver, IOCTL_DUMMY_TEST, … );
QueryPerformanceCounter(&After);
With a sample WDM Driver created by DriverWorks wizard,
It takes about ~0.210 ms
With a sample Win2k driver that I wrote using C
it takes only ~50 microssecond.
I have tried with both DriverWorks Debugbuild and Release build. The
Release build is a bit faster but it still in the odrder of 0.200ms
Anyone who used DriverWorks, have you timed the similar IOCTL and
experience the same thing as I did ?
I expect a little overhead with C++ but not that much.
The overhead is because of C++ or because of DriverWorks ??
Is there any thing I can do with DriverWorks to improve performance
(compiler setting etc …)
I posted the question to Compuware Tech support but do not yet receive
the answers. I want to hear from you, the experts and the ones have much
experience with C++ and DriverWorks.
Both drivers are build uisng MSVC 6.0 and Win2K DDK
Please help,
QUANG