Welcome to Typemock Answers. Here you can ask and receive answers from other community members. And if you liked or disliked an answer or thread: react with an up- or downvote Enjoy!

Bad performance with Windows.Forms

0 votes
Hi again

I m facing very bad perfmormance when i initialize the Mockmanager and then try to show a windows form with a lot of controls on it. I think its monitoring all the calls to all classes thats why it behaves like this.

I have try to
MockManager.Init(false)
or
MockManager.CollectAllCalls=false
or
MockManager.LogFile=false;

hoping that performance will be inmroved but nothing :(
i just want to do i simple interface mock and pass it as an argument to a form constructor but the perfomance is very bad making it impossible to use MockManager

is there any other way i could speed up MockManager i just want it to behave like a simple interface mock at the begining b4 form load (so the form will load fast ) and use some of its extra features after form load

thnks
asked Jan 25, 2005 by tolisss (3,660 points)

9 Answers

0 votes
Hi again

I m facing very bad perfmormance when i initialize the Mockmanager and then try to show a windows form with a lot of controls on it. I think its monitoring all the calls to all classes thats why it behaves like this.



Hi,
This is a known issue, it happens when you are mocking a System class. When you mock a System class, TypeMock.NET will start mocking classes that are in the System namespace, this classes need to be re-jitted, and this is what takes time. I will talk to our development team and see what they can do about it.

Just tell me, how much time does it take the test to run?
answered Jan 25, 2005 by scott (29,080 points)
0 votes
Im on 2.6GHz celeron with 1G ram adn i tried on a form with several controls from DevExpress 2 grids ,2 lookupedis ,2 dateedits, 2 textedits the time required is about 10sec for its form initializations. And if u want to initialize the form for each test imagine the time :(
answered Jan 25, 2005 by tolisss (3,660 points)
0 votes
Hi,

We are going to solve this issue in version 2.1, This version should be released in the begining of February.
The version will contain:
1. Visual Studio AddIn
2. Support for ref and out arguments
3. Mock.Clear to clear expectations
4. Support all cases of exception handlers (The current version doesn't support all cases)
5. System type performance

If you want, I can send you a link to download a beta of version 2.1
answered Jan 25, 2005 by scott (29,080 points)
0 votes
please do so
answered Jan 25, 2005 by tolisss (3,660 points)
0 votes
Done offline.
answered Jan 25, 2005 by scott (29,080 points)
0 votes
Hi,

We are going to solve this issue in version 2.1, This version should be released in the begining of February.
The version will contain:
1. Visual Studio AddIn
2. Support for ref and out arguments
3. Mock.Clear to clear expectations
4. Support all cases of exception handlers (The current version doesn't support all cases)
5. System type performance

If you want, I can send you a link to download a beta of version 2.1


i suppose that #5 inculdes fixing my performance problem i used the new beta but performance remain unchaged

This is a known issue, it happens when you are mocking a System class. When you mock a System class, TypeMock.NET will start mocking classes that are in the System namespace, this classes need to be re-jitted, and this is what takes time. I will talk to our development team and see what they can do about it.

actually i m not trying to mock anything i m doing
MockManager.Init();
new Form1().Show();

i hope we are speaking for the same manner
answered Jan 26, 2005 by tolisss (3,660 points)
0 votes
actually i m not trying to mock anything i m doing
MockManager.Init();
new Form1().Show();

i hope we are speaking for the same manner


OK, let try the following:
*Please read carefully*

1. Did you close all the testing processes before installation? If not please restart all the testing applications (GUI's, Visual Studio, Consoles).
2. Is the TypeMock library copied locally (Choose TypeMock under References in the Solution View and check if the Local Copy Property is false) ? If not please delete the copy from the output library and change Local Copy to false. To check if you are using the correct library (2.1) see if you have the Clear method for Mock classes, or look at the version in the Property View.
3. How long does it take to run without the MockManager.Init(); line?
4. If all these are ok, Please look at the How to submit bugs topic, run the tests in console mode, and look at the TypeMock.out file to see what methods are being Monitored, if there are a lot, this might be the reason. Submit the file and we will be able to analyse it.
answered Jan 26, 2005 by scott (29,080 points)
0 votes
This topic is continued in the Bugs forum Performance topic.
answered Jan 26, 2005 by scott (29,080 points)
0 votes
This has been fixed in Version 2.1
answered Feb 4, 2005 by richard (3,900 points)
...