Forum Discussion

tuanvinh1008's avatar
tuanvinh1008
Contributor
3 years ago

Do USEUNIT impact to performance when running script?

Dear all,

I'm not sure if Im using the USEUNIT to call other functions from other scripts when I need it or add all them into one script and only import it for other scripts

Ex:

The 1st way

Script A

Script B

Script C

Script D

  //USEUNIT A

  //USEUNIT B

  //USEUNIT C

 

The 2st way

Script common

  //USEUNIT A

  //USEUNIT B

  //USEUNIT C

  //USEUNIT E

 

Script A

//USEUNIT common

Script B

//USEUNIT common

Script C

//USEUNIT common

Script E

//USEUNIT common

 

so when the TestComplete is running, does it load all code of script in common in memory or not? is the 2nd way impact to performance if there are a huge scripts in a test suites?

 

Thanks,

Vinh

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Vinh,

     

    I think that you need to ask Support via the https://support.smartbear.com/testcomplete/message/ form for official but not guessed answer.

     

    To my level of knowledge, any script language runtime always loads and 'precompiles' script code before execution. This is functionality and architecture of script language runtime but not something that is specific to TestComplete itself.

    Thus I think that all statically available script code will be loaded before execution start regardless of the way you organize it.