os/ossrv/lowlevellibsandfws/pluginfw/TestExecute/EComPerfTest/src/Te_EComClientRequestPerfTestStep.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Te_EComClientRequrestPerfTestStep.cpp
    15 // Tests the performance of ECom client calls
    16 // 
    17 //
    18 
    19 /**
    20  @file
    21  @internalComponent
    22 */
    23 
    24 #include "Te_EComClientRequestPerfTestStep.h"
    25 #include <ecom/ecom.h>
    26 #include "Interface.h"
    27 #include "EComSessionAux.h"
    28 #include "EcomTestUtils.h"
    29 #include <cs_subconparams.h>
    30 #include "EComPerfTestDllTwo.h"
    31 
    32 #ifdef __ECOM_SERVER_PERFORMANCE__
    33 // Constants for list interface testing
    34 // There should be a single implementation of this interface in EComPerfTestDllOne.dll
    35 const TUid KUidListImplTestInterface = {0x10009DF3};
    36 // The resolver implementation uid in EComClientRequestPerfTestResolver.dll
    37 const TUid KCustomResolverImplementationUid = {0x10009DF8};
    38 // Constants for create implementation testing
    39 // these are implementations from EComPerfTestDllTwo.dll
    40 const TUid KUidCreateImplementation = {0x10009DF6};
    41 // There should be a single implementation of this interface in EComPerfTestDllTwo.dll
    42 const TUid KUidCreateImplTestInterface = {0x10009DF4};
    43 // Constants for GetExtendedInterface and ListExtendedInterface testing
    44 // these are implementations from EComExample10.dll
    45 const TUid KExample10ImplementationUid = {0x10009E38};
    46 const TUid KExample10ImplementationUid2 = {0x10009E3A};
    47 // Expected data type
    48 _LIT8(KExpectedDataTypeDllOne,"ECom_Performance1");
    49 _LIT8(KExpectedDataTypeDllTwo,"ECom_Performance2-1");
    50 _LIT8(KExpectedDataTypeExample10, "Example 10");
    51 // Extended Interfaces
    52 const TUid KExtendedInterfaceUid1 = {0x10009E44};
    53 const TUid KExtendedInterfaceUid2 = {0x10009E45};
    54 const TUid KExtendedInterfaceUid3 = {0x10009E46};
    55 // Uids for list implementation and create implementation test with extended interfaces. 
    56 const TUid KExample10InterfaceUid = {0x10009DBB}; 
    57 
    58 // Start-up urel/armv5 test limits for H2 RAM(non-NAND) hardware configuration. These figures were determined using benchmarks from the ONB&TR.
    59 // Although these limits are passed to CheckPerformance() for non urel/armv5 testing this method
    60 // does not test against them. It is disabled.
    61 // The following constants are test limit allowances that are used for each client request test. The limit
    62 // for each test is determined by adding together these limits as appropriate.
    63 // We do not provide special set of constants for H2 NAND cofiguration because H2 NAND tests are not performed.
    64 const TReal KBasicH2RAM = 5;
    65 const TReal KSecurityInfoRetrievedH2RAM = 5;
    66 const TReal KDefaultResolverH2RAM = 2;
    67 const TReal KCustomResolverH2RAM = 5;
    68 const TReal KDllLoadedH2RAM = 3;
    69 const TReal KFetchExtendedInterfaceH2RAM = 1; 
    70 const TReal KListExtendedInterfacesH2RAM = 1;
    71 const TReal KExtendedInterfacesMatchedH2RAM = 2; 
    72 // Start-up urel/armv5 test limits for H4 RAM(non-NAND) hardware configuration. These constants were determined using benchmarks from the ONB&TR.
    73 const TReal KBasicH4RAM = 2;
    74 const TReal KSecurityInfoRetrievedH4RAM = 3;
    75 const TReal KDefaultResolverH4RAM = 1;
    76 const TReal KCustomResolverH4RAM = 3;
    77 const TReal KDllLoadedH4RAM = 2;
    78 const TReal KFetchExtendedInterfaceH4RAM = 1; 
    79 const TReal KListExtendedInterfacesH4RAM = 1; 
    80 const TReal KExtendedInterfacesMatchedH4RAM = 1; 
    81 // Start-up urel/armv5 test limits for H4 NAND ROM configuration. These constants were determined using benchmarks from the ONB&TR.
    82 const TReal KBasicH4NAND = 3;
    83 const TReal KSecurityInfoRetrievedH4NAND = 9;
    84 const TReal KDefaultResolverH4NAND = 2;
    85 const TReal KCustomResolverH4NAND = 8;
    86 const TReal KDllLoadedH4NAND = 7;
    87 const TReal KFetchExtendedInterfaceH4NAND = 1; 
    88 const TReal KListExtendedInterfacesH4NAND = 1; 
    89 const TReal KExtendedInterfacesMatchedH4NAND = 2; 
    90 // Start-up urel/armv5 test limits for H6 RAM(non-NAND) hardware configuration. These constants were determined using benchmarks from the ONB&TR.
    91 const TReal KBasicH6RAM = 1;
    92 const TReal KSecurityInfoRetrievedH6RAM = 1.5;
    93 const TReal KDefaultResolverH6RAM = 1;
    94 const TReal KCustomResolverH6RAM = 1.5;
    95 const TReal KDllLoadedH6RAM = 1;
    96 const TReal KFetchExtendedInterfaceH6RAM = 1; 
    97 const TReal KListExtendedInterfacesH6RAM = 1; 
    98 const TReal KExtendedInterfacesMatchedH6RAM = 1; 
    99 // Start-up urel/armv5 test limits for H6 NAND ROM configuration. These constants were determined using benchmarks from the ONB&TR.
   100 const TReal KBasicH6NAND = 1.5;
   101 const TReal KSecurityInfoRetrievedH6NAND = 4;
   102 const TReal KDefaultResolverH6NAND = 1;
   103 const TReal KCustomResolverH6NAND = 4;
   104 const TReal KDllLoadedH6NAND = 3;
   105 const TReal KFetchExtendedInterfaceH6NAND = 1; 
   106 const TReal KListExtendedInterfacesH6NAND = 1; 
   107 const TReal KExtendedInterfacesMatchedH6NAND = 1; 
   108 //Specify the number of iterations to do to obtain the average value for API time measurement
   109 const TInt KNumberIteration=10;
   110 #endif // __ECOM_SERVER_PERFORMANCE__
   111 
   112 CEComClientRequestsPerfTest::CEComClientRequestsPerfTest() : CEComPerfTestBase(KEComClientRequestsPerfTest)
   113 	{
   114 	}
   115 
   116 CEComClientRequestsPerfTest::~CEComClientRequestsPerfTest()
   117 	{
   118 	}
   119 
   120 #ifdef __ECOM_SERVER_PERFORMANCE__
   121 void CEComClientRequestsPerfTest::WaitForDllUnload()
   122 	{
   123 #if defined(__EPOC32__) && !defined(_DEBUG)
   124 	// Timeout to unload dll when lazy unload is enabled - which it is by default
   125 	// Used only for HW release builds
   126 	const TInt32 KLazyUnloadTimeout = 150000000; // 2.5 minutes
   127 
   128 	// Wait for DLL to unload - target release builds only
   129 	User::After(KLazyUnloadTimeout);
   130 #else
   131 	INFO_PRINTF1(_L("*** WARNING: Use results with care no delay for DLL to unload ***\n"));
   132 #endif // #if defined(__EPOC32__) && !defined(_DEBUG)
   133 
   134 	}
   135 #endif // __ECOM_SERVER_PERFORMANCE__
   136 
   137 /*
   138  Test cases covered in the test step:
   139  
   140  1. Time calls to ListImplementationsL and CreateImplementationL without resolver, with default resolver and 
   141  with custom resolver under various conditions.
   142  	1.1 ListImplementationL performance testing without extended interfaces.
   143  	1.2 CreateImplementationL performance testing without extended interfaces.
   144  	1.3 ListImplementationL performance testing with extended interfaces.(TestCaseID:SYSLIB-ECOM-CT-3598)
   145  	1.4 CreateImplementationL performance testing with extended interfaces.(TestCaseID:SYSLIB-ECOM-CT-3599)
   146  
   147  2. Time calls to GetExtendedInterfaceL and ListExtendedInterfacesL under various conditions.
   148  	2.1 ListExtendedInterfacesL performance testing.(TestCaseID:SYSLIB-ECOM-CT-3600)
   149  	2.2 GetExtendedInterfaceL performance testing.(TestCaseID: SYSLIB-ECOM-CT-3601)
   150 
   151  1.3,1.4,2.1 and 2.2 are test cases for EC43
   152  @return EPass if the test completed successfully and the performance of the client calls are within the maximum
   153 */
   154 TVerdict CEComClientRequestsPerfTest::doTestStepL()
   155 	{
   156 #ifdef __ECOM_SERVER_PERFORMANCE__
   157 	RImplInfoPtrArray ifArray;
   158 	RArray<TUid> extendedInterfaces;
   159 	CleanupClosePushL(extendedInterfaces);
   160 	extendedInterfaces.AppendL(KExtendedInterfaceUid1);
   161 	extendedInterfaces.AppendL(KExtendedInterfaceUid2);
   162 	extendedInterfaces.AppendL(KExtendedInterfaceUid3);
   163 	//set configuration-dependent timing limits (for non-NAND and NAND ROM configurations)
   164 	TReal limitBasic = 0;
   165 	TReal limitSecurityInfoRetrieved = 0;
   166 	TReal limitDefaultResolver = 0;
   167 	TReal limitCustomResolver = 0;
   168 	TReal limitDllLoaded = 0;
   169 	TReal limitFetchExtendedInterface = 0;
   170 	TReal limitListExtendedInterfaces = 0;
   171 	TReal limitExtendedInterfaceMatched = 0;
   172 	
   173 	THardwareConfiguration hardware_configuration = EComTestUtils::GetHardwareConfiguration();
   174 	switch (hardware_configuration)
   175 		{
   176 		case EPlatformH2RAM:
   177 	    	limitBasic = KBasicH2RAM;
   178 			limitSecurityInfoRetrieved = KSecurityInfoRetrievedH2RAM;
   179 			limitDefaultResolver = KDefaultResolverH2RAM;
   180 			limitCustomResolver = KCustomResolverH2RAM;
   181 			limitDllLoaded = KDllLoadedH2RAM;
   182 			limitFetchExtendedInterface = KFetchExtendedInterfaceH2RAM;
   183 			limitListExtendedInterfaces = KListExtendedInterfacesH2RAM;
   184 			limitExtendedInterfaceMatched = KExtendedInterfacesMatchedH2RAM;
   185 			INFO_PRINTF1(_L("Hardware configuration: H2 RAM"));
   186 			break;
   187 			
   188 		case EPlatformH2NAND:
   189 			INFO_PRINTF1(_L("Hardware configuration: H2 NAND"));
   190 			INFO_PRINTF1(_L("***Performance testing on H2 NAND is not supported!***"));
   191 			SetTestStepResult(EFail);			
   192 			break;
   193 			
   194 		case EPlatformH2NANDDP:
   195 			INFO_PRINTF1(_L("Hardware configuration: H2 NAND DP"));
   196 			INFO_PRINTF1(_L("***Performance testing on H2 NAND DP is not supported!***"));
   197 			SetTestStepResult(EFail);			
   198 			break;
   199 		
   200 		case EPlatformH4RAM:
   201 			limitBasic = KBasicH4RAM;
   202 			limitSecurityInfoRetrieved = KSecurityInfoRetrievedH4RAM;
   203 			limitDefaultResolver = KDefaultResolverH4RAM;
   204 			limitCustomResolver = KCustomResolverH4RAM;
   205 			limitDllLoaded = KDllLoadedH4RAM;
   206 			limitFetchExtendedInterface = KFetchExtendedInterfaceH4RAM;
   207 			limitListExtendedInterfaces = KListExtendedInterfacesH4RAM;
   208 			limitExtendedInterfaceMatched = KExtendedInterfacesMatchedH4RAM;
   209 			INFO_PRINTF1(_L("Hardware configuration: H4 RAM"));
   210 			break;
   211 		
   212 		case EPlatformH4NAND:		
   213 			limitBasic = KBasicH4NAND;
   214 			limitSecurityInfoRetrieved = KSecurityInfoRetrievedH4NAND;
   215 			limitDefaultResolver = KDefaultResolverH4NAND;
   216 			limitCustomResolver = KCustomResolverH4NAND;
   217 			limitDllLoaded = KDllLoadedH4NAND;
   218 			limitFetchExtendedInterface = KFetchExtendedInterfaceH4NAND;
   219 			limitListExtendedInterfaces = KListExtendedInterfacesH4NAND;
   220 			limitExtendedInterfaceMatched = KExtendedInterfacesMatchedH4NAND;			
   221 			INFO_PRINTF1(_L("Hardware configuration: H4 NAND"));			
   222 			break;
   223 		
   224 		case EPlatformH4NANDDP:	
   225 			INFO_PRINTF1(_L("Hardware configuration: H4 NAND DP"));
   226 			break;
   227 			
   228 		case EPlatformH6RAM:
   229 			limitBasic = KBasicH6RAM;
   230 			limitSecurityInfoRetrieved = KSecurityInfoRetrievedH6RAM;
   231 			limitDefaultResolver = KDefaultResolverH6RAM;
   232 			limitCustomResolver = KCustomResolverH6RAM;
   233 			limitDllLoaded = KDllLoadedH6RAM;
   234 			limitFetchExtendedInterface = KFetchExtendedInterfaceH6RAM;
   235 			limitListExtendedInterfaces = KListExtendedInterfacesH6RAM;
   236 			limitExtendedInterfaceMatched = KExtendedInterfacesMatchedH6RAM;
   237 			INFO_PRINTF1(_L("Hardware configuration: H6 RAM"));
   238 			break;
   239 		
   240 		case EPlatformH6NAND:		
   241 			limitBasic = KBasicH6NAND;
   242 			limitSecurityInfoRetrieved = KSecurityInfoRetrievedH6NAND;
   243 			limitDefaultResolver = KDefaultResolverH6NAND;
   244 			limitCustomResolver = KCustomResolverH6NAND;
   245 			limitDllLoaded = KDllLoadedH6NAND;
   246 			limitFetchExtendedInterface = KFetchExtendedInterfaceH6NAND;
   247 			limitListExtendedInterfaces = KListExtendedInterfacesH6NAND;
   248 			limitExtendedInterfaceMatched = KExtendedInterfacesMatchedH6NAND;			
   249 			INFO_PRINTF1(_L("Hardware configuration: H6 NAND"));			
   250 			break;
   251 		case EPlatformH6NANDDP:	
   252 			INFO_PRINTF1(_L("Hardware configuration: H6 NAND DP"));
   253 			break;
   254 		
   255 		case EPlatformWINSCW:
   256 			INFO_PRINTF1(_L("Hardware configuration: WINSCW"));
   257 			break;
   258 		
   259 		default:
   260 			INFO_PRINTF1(_L("***Unrecognized platform!***"));
   261 			SetTestStepResult(EFail);
   262 			break;		
   263 		}
   264 
   265 	//
   266 	// 1.1 ListImplementationL performance testing without extended interfaces.
   267 	//
   268 	TInt totalTime=0;
   269 	INFO_PRINTF1(_L("Time servicing ListImplementationsL requests - each request returns 4 implementations:\n"));
   270 	//
   271 	// Time ListImplementationsL without resolver
   272 	//
   273 	TInt startTime = User::FastCounter();
   274 	REComSession::ListImplementationsL(KUidListImplTestInterface, ifArray);
   275 	TInt endTime = User::FastCounter();
   276 	TEST(ifArray.Count()==4);
   277 	ifArray.ResetAndDestroy();
   278 	TReal netTime = FastCountToMilliseconds(endTime-startTime);
   279 	CheckPerformance(netTime, limitBasic+limitSecurityInfoRetrieved, _L("Call with: no resolver, security info retrieval"));
   280 
   281 	//
   282 	// Average Time over KNumberIteration ListImplementationsL without resolver when the DLL security info is cached
   283 	//
   284 	totalTime=0;
   285 	for (TInt i=0;i<KNumberIteration;i++)
   286 		{
   287 		startTime = User::FastCounter();
   288 		REComSession::ListImplementationsL(KUidListImplTestInterface, ifArray);
   289 		endTime = User::FastCounter();
   290 		TEST(ifArray.Count()==4);
   291 		ifArray.ResetAndDestroy();
   292 		totalTime+=(endTime-startTime);
   293 		}
   294 		netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   295 		CheckPerformance(netTime, limitBasic, _L("Call with: no resolver, security info cached"));
   296 
   297 	//
   298 	// Average Time over KNumberIteration ListImplementationsL with default resolver when the DLL security info is cached
   299 	//
   300 	totalTime=0;
   301 	TEComResolverParams params;
   302 	params.SetDataType(KExpectedDataTypeDllOne());
   303 	params.SetGenericMatch(ETrue);
   304 	for (TInt i=0;i<KNumberIteration;i++)	
   305 		{	
   306 		startTime = User::FastCounter();
   307 		REComSession::ListImplementationsL(KUidListImplTestInterface, params, ifArray);
   308 		endTime = User::FastCounter();
   309 		TEST(ifArray.Count()==4);
   310 		ifArray.ResetAndDestroy();
   311 		totalTime+=(endTime-startTime);	
   312 		}
   313 		netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   314 		CheckPerformance(netTime, limitBasic+limitDefaultResolver, _L("Call with: default resolver, security info cached"));
   315 
   316 	//
   317 	// Average Time over KNumberIteration ListImplementationsL with custom resolver when the DLL security check is cached
   318 	//
   319 	totalTime=0;
   320 	for (TInt i=0;i<KNumberIteration;i++)	
   321 		{	
   322 		startTime = User::FastCounter();
   323 		REComSession::ListImplementationsL(KUidListImplTestInterface, params, KCustomResolverImplementationUid, ifArray);
   324 		endTime = User::FastCounter();
   325 		TEST(ifArray.Count()==4);
   326 		ifArray.ResetAndDestroy();
   327 		totalTime+=(endTime-startTime);
   328 		}
   329 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   330 	CheckPerformance(netTime, limitBasic+limitCustomResolver, _L("Call with: custom resolver, security info cached"));
   331 
   332 	//
   333 	// 1.2 CreateImplementationL performance testing without extended interfaces.
   334 	//
   335 	INFO_PRINTF1(_L("Time servicing CreateImplementationL requests:\n"));
   336 	//
   337 	// Time Create Implementation without resolver with retrieval of security info and dll will be loaded
   338 	//
   339 	TUid ecomDestructorId;
   340 	startTime = User::FastCounter();
   341 	CImplementationClassExampleTwo *ecomPtr = (CImplementationClassExampleTwo*)REComSession::CreateImplementationL(KUidCreateImplementation, ecomDestructorId);
   342 	endTime = User::FastCounter();
   343 	REComSession::DestroyedImplementation(ecomDestructorId);
   344 	delete ecomPtr;
   345 	netTime = FastCountToMilliseconds(endTime-startTime);
   346 	CheckPerformance(netTime, limitBasic+limitDllLoaded+limitSecurityInfoRetrieved, _L("Call with: no resolver, dll to be loaded, security info retrieval"));
   347 	REComSession::FinalClose();
   348 
   349 	WaitForDllUnload();
   350 
   351 	//
   352 	// Time CreateImplementation without resolver when the DLL security info cached and dll will be loaded
   353 	//
   354 	startTime = User::FastCounter();
   355 	ecomPtr = (CImplementationClassExampleTwo*)REComSession::CreateImplementationL(KUidCreateImplementation, ecomDestructorId);
   356 	endTime = User::FastCounter();
   357 	netTime = FastCountToMilliseconds(endTime-startTime);
   358 	CheckPerformance(netTime, limitBasic+limitDllLoaded, _L("Call with: no resolver, dll to be loaded, security info cached"));
   359 
   360 	//
   361 	// Average Time over KNumberIteration CreateImplementation without resolver when the DLL security info is cached and dll is already
   362 	// loaded
   363 	//
   364 	totalTime=0;
   365 	CImplementationClassExampleTwo *ecomPtr2=NULL;
   366 	TUid ecomDestructorId2;
   367 	for (TInt i=0;i<KNumberIteration;i++)	
   368 		{	
   369 		startTime = User::FastCounter();
   370 		ecomPtr2 = (CImplementationClassExampleTwo*)REComSession::CreateImplementationL(KUidCreateImplementation, ecomDestructorId2);
   371 		endTime = User::FastCounter();
   372 		totalTime+=endTime-startTime;
   373 		REComSession::DestroyedImplementation(ecomDestructorId2);
   374 		delete ecomPtr2;
   375 		}
   376 	REComSession::DestroyedImplementation(ecomDestructorId);
   377 	delete ecomPtr;
   378 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   379 	CheckPerformance(netTime, limitBasic, _L("Call with: no resolver, dll already loaded, security info cached"));
   380 	REComSession::FinalClose();
   381 
   382 	WaitForDllUnload();
   383 
   384 	//
   385 	// Time CreateImplementation with default resolver when the DLL security info cached and dll must be loaded
   386 	//
   387 	params.SetDataType(KExpectedDataTypeDllTwo);
   388 	startTime = User::FastCounter();
   389 	ecomPtr = (CImplementationClassExampleTwo*)REComSession::CreateImplementationL(KUidCreateImplTestInterface, ecomDestructorId, params);
   390 	endTime = User::FastCounter();
   391 	netTime = FastCountToMilliseconds(endTime-startTime);
   392 	CheckPerformance(netTime, limitBasic+limitDefaultResolver+limitDllLoaded, _L("Call with: default resolver, dll to be loaded, security info cached"));
   393 
   394 	//
   395 	// Average Time over KNumberIteration CreateImplementation with default resolver when the DLL security info is cached and dll is already
   396 	// loaded
   397 	//
   398 	totalTime=0;
   399 	for (TInt i=0;i<KNumberIteration;i++)	
   400 		{
   401 		startTime = User::FastCounter();
   402 		ecomPtr2 = (CImplementationClassExampleTwo*)REComSession::CreateImplementationL(KUidCreateImplTestInterface, ecomDestructorId2, params);
   403 		endTime = User::FastCounter();
   404 		totalTime+=endTime-startTime;
   405 		REComSession::DestroyedImplementation(ecomDestructorId2);
   406 		delete ecomPtr2;
   407 		}
   408 	REComSession::DestroyedImplementation(ecomDestructorId);
   409 	delete ecomPtr;	
   410 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   411 	CheckPerformance(netTime, limitBasic+limitDefaultResolver, _L("Call with: default resolver, dll already loaded, security info cached"));
   412 	REComSession::FinalClose();
   413 
   414 	WaitForDllUnload();
   415 
   416 	//
   417 	// Time CreateImplementation with custom resolver when the DLL security info cached and dll must be loaded
   418 	//
   419 	startTime = User::FastCounter();
   420 	ecomPtr = (CImplementationClassExampleTwo*)REComSession::CreateImplementationL(
   421 				KUidCreateImplTestInterface, ecomDestructorId, params, KCustomResolverImplementationUid);
   422 	endTime = User::FastCounter();
   423 	netTime = FastCountToMilliseconds(endTime-startTime);
   424 	CheckPerformance(netTime, limitBasic+limitCustomResolver+limitDllLoaded, _L("Call with: custom resolver, dll to be loaded, security info cached"));
   425 
   426 	//
   427 	// Average Time over KNumberIteration CreateImplementation with default resolver when the DLL security info is cached and dll is already
   428 	// loaded
   429 	//
   430 	totalTime=0;
   431 	for (TInt i=0;i<KNumberIteration;i++)	
   432 		{	
   433 		startTime = User::FastCounter();
   434 		ecomPtr2 = (CImplementationClassExampleTwo*)REComSession::CreateImplementationL(
   435 					KUidCreateImplTestInterface, ecomDestructorId2, params, KCustomResolverImplementationUid);
   436 		endTime = User::FastCounter();
   437 		totalTime+=endTime-startTime;	
   438 		REComSession::DestroyedImplementation(ecomDestructorId2);
   439 		delete ecomPtr2;
   440 		}
   441 	REComSession::DestroyedImplementation(ecomDestructorId);
   442 	delete ecomPtr;	
   443 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   444 	CheckPerformance(netTime, limitBasic+limitCustomResolver, _L("Call with: custom resolver, dll already loaded, security info cached"));
   445 
   446 	//
   447 	// 1.3 ListImplementationL performance testing with extended interfaces.
   448 	//
   449 	totalTime = 0;
   450 	INFO_PRINTF1(_L("Time servicing ListImplementationsL with extended interfaces requests:\n"));
   451 	//
   452 	// Time ListImplementationsL with extended interfaces without resolver
   453 	//
   454 	startTime = User::FastCounter();
   455 	REComSession::ListImplementationsL(KExample10InterfaceUid, extendedInterfaces, ifArray);
   456 	endTime = User::FastCounter();
   457 	TEST(ifArray.Count() == 1);
   458 	ifArray.ResetAndDestroy();
   459 	netTime = FastCountToMilliseconds(endTime-startTime);
   460 	CheckPerformance(netTime, limitBasic+limitSecurityInfoRetrieved+limitExtendedInterfaceMatched, _L("Call with: extended interfaces, no resolver, security info retrieval"));
   461 
   462 	//
   463 	// Average Time over KNumberIteration ListImplementationsL with extended interfaces,without resolver when the DLL security info is cached
   464 	//
   465 	totalTime=0;
   466 	for (TInt i = 0; i < KNumberIteration; i++)
   467 		{
   468 		startTime = User::FastCounter();
   469 		REComSession::ListImplementationsL(KExample10InterfaceUid, extendedInterfaces, ifArray);
   470 		endTime = User::FastCounter();
   471 		TEST(ifArray.Count() == 1);
   472 		ifArray.ResetAndDestroy();
   473 		totalTime += (endTime-startTime);
   474 		}
   475 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   476 	CheckPerformance(netTime, limitBasic+limitExtendedInterfaceMatched, _L("Call with: extended interfaces, no resolver, security info cached"));
   477 
   478 	//
   479 	// Average Time over KNumberIteration ListImplementationsL with extended interfaces, with default resolver when the DLL security info is cached
   480 	//
   481 	totalTime = 0;
   482 	params.SetDataType(KExpectedDataTypeExample10());
   483 	params.SetGenericMatch(ETrue);
   484 	for (TInt i = 0; i < KNumberIteration; i++)	
   485 		{	
   486 		startTime = User::FastCounter();
   487 		REComSession::ListImplementationsL(KExample10InterfaceUid, extendedInterfaces, params, ifArray);
   488 		endTime = User::FastCounter();
   489 		TEST(ifArray.Count() == 1);
   490 		ifArray.ResetAndDestroy();
   491 		totalTime += (endTime-startTime);	
   492 		}
   493 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   494 	CheckPerformance(netTime, limitBasic+limitDefaultResolver+limitExtendedInterfaceMatched, _L("Call with: extended interfaces, default resolver, security info cached"));
   495 
   496 	//
   497 	// Average Time over KNumberIteration ListImplementationsL with extended interfaces, with custom resolver when the DLL security check is cached
   498 	//
   499 	totalTime = 0;
   500 	for (TInt i = 0; i < KNumberIteration; i++)	
   501 		{	
   502 		startTime = User::FastCounter();
   503 		REComSession::ListImplementationsL(KExample10InterfaceUid, extendedInterfaces, params, KCustomResolverImplementationUid, ifArray);
   504 		endTime = User::FastCounter();
   505 		TEST(ifArray.Count() == 1);
   506 		ifArray.ResetAndDestroy();
   507 		totalTime += (endTime-startTime);
   508 		}
   509 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   510 	CheckPerformance(netTime, limitBasic+limitCustomResolver+limitExtendedInterfaceMatched, _L("Call with: extended interfaces, custom resolver, security info cached"));
   511 	
   512 	//
   513 	// 1.4 CreateImplementationL performance testing with extended interfaces.
   514 	//
   515 	CExampleInterface* dllPtr = NULL;
   516 	CExampleInterface* dllPtr2 = NULL;
   517 	totalTime = 0;
   518 	INFO_PRINTF1(_L("Time servicing CreateImplementationsL with extended interfaces requests:\n"));
   519 	//
   520 	// Time CreateImplementation with extended interfaces, default resolver when the DLL security info cached and dll must be loaded
   521 	//
   522 	params.SetDataType(KExpectedDataTypeExample10);
   523 	startTime = User::FastCounter();
   524 	dllPtr = reinterpret_cast<CExampleInterface*>(REComSession::CreateImplementationL(KExample10InterfaceUid, extendedInterfaces, ecomDestructorId, params));
   525 	endTime = User::FastCounter();
   526 	netTime = FastCountToMilliseconds(endTime-startTime);
   527 	CheckPerformance(netTime, limitBasic+limitDefaultResolver+limitDllLoaded+limitExtendedInterfaceMatched, _L("Call with: extended interfaces, default resolver, dll to be loaded, security info cached"));
   528 	
   529 	//
   530 	// Average Time over KNumberIteration CreateImplementation with extended interfaces, default resolver when the DLL security info is cached and dll is already
   531 	// loaded
   532 	//
   533 	totalTime = 0;
   534 	for (TInt i = 0; i < KNumberIteration; i++)	
   535 		{
   536 		startTime = User::FastCounter();
   537 		dllPtr2 = reinterpret_cast<CExampleInterface*>(REComSession::CreateImplementationL(KExample10InterfaceUid, extendedInterfaces, ecomDestructorId2, params));
   538 		endTime = User::FastCounter();
   539 		totalTime += endTime-startTime;
   540 		REComSession::DestroyedImplementation(ecomDestructorId2);
   541 		delete dllPtr2;
   542 		}
   543 	REComSession::DestroyedImplementation(ecomDestructorId);
   544 	delete dllPtr;	
   545 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   546 	CheckPerformance(netTime, limitBasic+limitDefaultResolver+limitExtendedInterfaceMatched, _L("Call with: extended interfaces, default resolver, dll already loaded, security info cached"));
   547 	REComSession::FinalClose();
   548 	WaitForDllUnload();
   549 
   550 	//
   551 	// Time CreateImplementation with extended interfaces, custom resolver when the DLL security info cached and dll must be loaded
   552 	//
   553 	startTime = User::FastCounter();
   554 	dllPtr = reinterpret_cast<CExampleInterface*>(REComSession::CreateImplementationL(
   555 		KExample10InterfaceUid, extendedInterfaces, ecomDestructorId, params, KCustomResolverImplementationUid));
   556 	endTime = User::FastCounter();
   557 	netTime = FastCountToMilliseconds(endTime-startTime);
   558 	CheckPerformance(netTime, limitBasic+limitCustomResolver+limitDllLoaded+limitExtendedInterfaceMatched, _L("Call with: extended interfaces, custom resolver, dll to be loaded, security info cached"));
   559 
   560 	//
   561 	// Average Time over KNumberIteration CreateImplementation with extended interfaces, custom resolver when the DLL security info is cached and dll is already
   562 	// loaded
   563 	//
   564 	totalTime = 0;
   565 	for (TInt i = 0; i < KNumberIteration; i++)	
   566 		{	
   567 		startTime = User::FastCounter();
   568 		dllPtr2 = reinterpret_cast<CExampleInterface*>(REComSession::CreateImplementationL(
   569 			KExample10InterfaceUid, extendedInterfaces, ecomDestructorId2, params, KCustomResolverImplementationUid));
   570 		endTime = User::FastCounter();
   571 		totalTime += endTime-startTime;	
   572 		REComSession::DestroyedImplementation(ecomDestructorId2);
   573 		delete dllPtr2;
   574 		}
   575 	REComSession::DestroyedImplementation(ecomDestructorId);
   576 	delete dllPtr;	
   577 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   578 	CheckPerformance(netTime, limitBasic+limitCustomResolver+limitExtendedInterfaceMatched, _L("Call with: extended interfaces, custom resolver, dll already loaded, security info cached"));
   579 	
   580 	REComSession::FinalClose();
   581 	WaitForDllUnload();
   582 	CleanupStack::PopAndDestroy(&extendedInterfaces);
   583 
   584 	//
   585 	// 2.1 ListExtendedInterfacesL performance testing.
   586 	//
   587 	RArray<TUid> ifInfo;
   588 	CleanupClosePushL(ifInfo);
   589 	totalTime = 0;
   590 	for (TInt i = 0; i < KNumberIteration; i++)	
   591 		{
   592 		startTime = User::FastCounter();
   593 		REComSession::ListExtendedInterfacesL(KExample10ImplementationUid,ifInfo);
   594 		endTime = User::FastCounter();
   595 		// Ensure test is valid by testing return parameters
   596 		TEST(ifInfo.Count() == 3);
   597 		totalTime += endTime-startTime;
   598 		ifInfo.Reset();
   599 		}
   600 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   601 	CheckPerformance(netTime, limitListExtendedInterfaces, _L("List extended interface. Three interfaces returned."));
   602 		
   603 	// Test with no interfaces returned
   604 	totalTime = 0;
   605 	for (TInt i = 0; i < KNumberIteration; i++)	
   606 		{
   607 		startTime = User::FastCounter();
   608 		REComSession::ListExtendedInterfacesL(KExample10ImplementationUid2,ifInfo);
   609 		endTime = User::FastCounter();
   610 		// Ensure test is valid by testing return parameters
   611 		TEST(ifInfo.Count() == 0);
   612 		totalTime += endTime-startTime;
   613 		ifInfo.Reset();
   614 		}
   615 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   616 	CheckPerformance(netTime, limitListExtendedInterfaces, _L("List extended interface. No interface returned."));
   617 	CleanupStack::PopAndDestroy(&ifInfo);
   618 
   619 	//
   620 	// 2.2 GetExtendedInterfaceL performance testing.
   621 	//
   622 	
   623 	TUid instanceKey;
   624 	// Set up some empty initialisation parameters
   625 	CExampleInterface::TExampleInterfaceInitParams initParams;
   626 	initParams.integer		= 0;
   627 	initParams.descriptor	= NULL;
   628 	dllPtr = REINTERPRET_CAST(CExampleInterface*, 
   629 							REComSession::CreateImplementationL(KExample10ImplementationUid,
   630 															   instanceKey,
   631 															   &initParams));
   632 	
   633 	// Call extended interface here.
   634 	totalTime = 0;
   635 	for (TInt i = 0; i < KNumberIteration; i++)	
   636 		{
   637 		startTime = User::FastCounter();
   638 		MExampleInterfaceExtended* ext1 = static_cast<MExampleInterfaceExtended*>(REComSession::GetExtendedInterfaceL(instanceKey, KExtendedInterfaceUid1 ));
   639 		endTime = User::FastCounter();
   640 		totalTime += endTime - startTime;
   641 		}
   642 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   643 	CheckPerformance(netTime, limitFetchExtendedInterface, _L("Get extended interface. Interface is part of main instantiation object."));
   644 	totalTime = 0;
   645 	for (TInt i = 0; i < KNumberIteration; i++)	
   646 		{
   647 		startTime = User::FastCounter();
   648 		MExampleInterfaceExtended2* ext2 = static_cast<MExampleInterfaceExtended2*>(REComSession::GetExtendedInterfaceL(instanceKey, KExtendedInterfaceUid2 ));
   649 		endTime = User::FastCounter();
   650 		totalTime += endTime - startTime;
   651 		}
   652 	netTime = (FastCountToMilliseconds(totalTime))/KNumberIteration;
   653 	CheckPerformance(netTime, limitFetchExtendedInterface, _L("Get extended interface. Interface is separate object."));
   654 	REComSession::DestroyedImplementation(instanceKey);
   655 	delete dllPtr;
   656 	REComSession::FinalClose();
   657 #else
   658 	MacroNotDefinedError();
   659 #endif // __ECOM_SERVER_PERFORMANCE__
   660 	return TestStepResult();
   661 	}