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?