CoCreateInstance
-
I am executing the following code in VC. ----------- HRESULT hr = CoInitialize( NULL ); hr = CoCreateInstance( CLSID_RegExp, NULL, CLSCTX_SERVER, IID_IRegExp, (void**)&m_pIRegExp); CoUninitialize(); --------------- I find that in the first execution(i.e. after restarting my machine) the time taken to execute this code is more than the subsequent executions. The main time taken in case of 1st run is by CoCreateInstance I am measuring the time taken using IBM's Rational(so I can trust their output). Can u help me figure out the problem? Is it that for the 1st time I run the application, some dll's are loaded in the memory which doesnot happen in the subsequent runs? Is this some funda of COM? Please help. P.S. Performance improvement is my main focus Chirag Saglani
-
I am executing the following code in VC. ----------- HRESULT hr = CoInitialize( NULL ); hr = CoCreateInstance( CLSID_RegExp, NULL, CLSCTX_SERVER, IID_IRegExp, (void**)&m_pIRegExp); CoUninitialize(); --------------- I find that in the first execution(i.e. after restarting my machine) the time taken to execute this code is more than the subsequent executions. The main time taken in case of 1st run is by CoCreateInstance I am measuring the time taken using IBM's Rational(so I can trust their output). Can u help me figure out the problem? Is it that for the 1st time I run the application, some dll's are loaded in the memory which doesnot happen in the subsequent runs? Is this some funda of COM? Please help. P.S. Performance improvement is my main focus Chirag Saglani
The initial delay is because the operating system does much initialization under the hood (DLL loading, etc). This was the case under Windows 9x, but I have not observed this under Windows NT-based operating systems. --
-
The initial delay is because the operating system does much initialization under the hood (DLL loading, etc). This was the case under Windows 9x, but I have not observed this under Windows NT-based operating systems. --
Thank you for the reply. I am using Windows XP ans still facing this problem. Can u also please tell me what exactly happens during CoCreateInstance (which DLL is loaded etc)that is taking more time in the first execution? Thanx
-
I am executing the following code in VC. ----------- HRESULT hr = CoInitialize( NULL ); hr = CoCreateInstance( CLSID_RegExp, NULL, CLSCTX_SERVER, IID_IRegExp, (void**)&m_pIRegExp); CoUninitialize(); --------------- I find that in the first execution(i.e. after restarting my machine) the time taken to execute this code is more than the subsequent executions. The main time taken in case of 1st run is by CoCreateInstance I am measuring the time taken using IBM's Rational(so I can trust their output). Can u help me figure out the problem? Is it that for the 1st time I run the application, some dll's are loaded in the memory which doesnot happen in the subsequent runs? Is this some funda of COM? Please help. P.S. Performance improvement is my main focus Chirag Saglani
Hi Chirag, Check if the regular expression libraries are installed properly. There might be some collision between your "RegExp" library CLSID's... I am just guessing, you can have a look... OR Try to design some simple application in VB using "Regular Expression" library. This might tell you where exactly the problem is... I cant see other things that should take time... all the best ! Cheers, Vishal -- modified at 8:09 Tuesday 11th October, 2005