0 people following this project (follow)

Project Description
NPerformant is a framework that allows the user to compare the performance of different algorithms with an NUnit feel. It is extensible to allow the inclusion of additional performance metrics if desired, but ships with a simple performance evaluator to compare methods by time and best guess memory usage after the test completed.

As of now, I haven't completed the project to the point you can down load the binaries and run command line (a la NUnit), but that's coming soon.  Just wanted to publish the framework code to get a few eyes on it and get the ball rolling.

Here's a quick sample fixture, explained in more detail in the documentation section:

[PerformantFixture(typeof(BasicPerformanceEvaluator), FixtureName = "ForEach Tests", Iterations = 100)]
public class ForEachTest
{
    private const string TEST_STRING = "TEST";
    private const int TEST_INT = 123;

    private readonly List<TestObject> testObjects = new List<TestObject>();

    public void SetupTestObjectsPerFixture()
    {
        for (var i = 0; i < 100000; i++)
        {
            testObjects.Add(new TestObject());
        }
    }

    public virtual void RunLanguageForTest()
    {
        TestObject testObject;
        for(var i = 0; i < testObjects.Count; i++)
        {
            testObject = testObjects[i];
            testObject.TestString = TEST_STRING;
            testObject.TestInt = TEST_INT;
        }
    }

    public virtual void RunNativeForEachTest()
    {
        foreach(var testObject in testObjects)
        {
            testObject.TestString = TEST_STRING;
            testObject.TestInt = TEST_INT;
        }
    }

    public virtual void RunLinqForEachWithLambdaTest()
    {
        testObjects.ForEach(to =>
        {
            to.TestString = TEST_STRING;
            to.TestInt = TEST_INT;
        });
    }

    public void TearDownTestObjects()
    {
        testObjects.Clear();      
    }
}

Check out the documentation for more information on using NPerformant.

As of now the project is in early Alpha.  It will run the basic basic test metrics via the ConsoleTestRunner that ships with the framework, but the output is not pretty yet. There will be many more features coming that will make the tool much more usable in the future.  For now I'm just trying to get other eyes and hands into the project to help push it along.  Please feel free to leave feedback, issues and feature requests any time.  I would really appreciate your help and support. 

Last edited May 27 2011 at 2:30 PM by armount, version 9