chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
Hi.

Recently we are start testing Typemock as Mock framework for our tests. We're write 200+ tests and add hundreds TestCases. For CI we use TeamCity 7.0. And UnitTesting framework is NUnit. So, actually we have 789 tests.

Two days ago we install new Typemock 7 and... Little bit surprised. Before update all our tests has passed for 1m:46s. After update to new version the time is 10m:53s. I'm not belive to my eyes and write a little test project:
using System;
using System.Diagnostics;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using TypeMock.ArrangeActAssert;

namespace TestTypeMock
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestFixture, Isolated]
    public class UnitTest1
    {
        [Test]
        public void TestMethod1()
        {
            var stopWatch = Stopwatch.StartNew();
            var list = new List<TestClass>();
            for (int i = 0; i < 10000; i++)
            {
                list.Add(new TestClass());
            }

            var created = stopWatch.Elapsed;
            Trace.WriteLine(string.Format("Created for {0}", created));

            foreach (var testClass in list)
            {
                testClass.DoWork();
            }

            var called = stopWatch.Elapsed;
            Trace.WriteLine(string.Format("Called for {0}", called - created));
        }
    }

    public class TestClass
    {
        public void DoWork()
        {
            
        }
    }
}


You can see, that in test project I actually not use TypeMock, but use IsolatedAttribute. As I understand, if reference to TypeMock is declared in code, then Test will started in Isolator environment. So, for testing Performance I just comment IsolatedAttribute and run test.
The results is amazing:
Without Isolator:
Created for 00:00:00.0007968
Called for 00:00:00.0198309

V6:
Created for 00:00:00.0033083
Called for 00:00:00.0385706

V7:
Created for 00:00:00.0288309
Called for 00:00:00.0667871

As we can see object creation in Isolator V7 in comparison with V6 is !!! x9 !!! slower. Method call in V7 in comparison with V6 is almost x2 slower.
Can someone from TypeMock team comment that huge performance reduction? Is this an Issue or Feature of new version?
asked by Settler (640 points)

3 Answers

0 votes
Hi Settler,

This is true, this version has a performance hit. We're fixing it and it'll be released in the next few days. We'll update on this thread the moment it's ready.

Regards,
Elisha,
Typemock Support
answered by Elisha (12k points)
0 votes
Thnx for answer. I will wait for fix.
answered by Settler (640 points)
0 votes
Hi,

The performance issue was fixed in version 7.0.2, anyone encountered it can download a new version here.

Regards,
Elisha,
Typemock Support
answered by Elisha (12k points)
...