← Back to team overview

nunit-core team mailing list archive

[Bug 761579] Re: Tests using log4net run very slowly

 

** Attachment added: "NUnitTest.zip"
   https://bugs.launchpad.net/bugs/761579/+attachment/2039829/+files/NUnitTest.zip

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/761579

Title:
  Tests using log4net run very slowly

Status in NUnit V2 Test Framework:
  New

Bug description:
  I've recently been upgrading some tests from NUnit 2.2.8 to 2.5.8 and
  noticed they were running a lot slower with the newer version of
  NUnit. I managed to narrow it down to their usage of log4net.

  For example, the following test runs in 0.06 seconds on my machine
  using 2.2.8, but with 2.5.8 it takes 4.5 seconds. This is using .NET
  2.0 on 32-bit Windows 7.

  [Test]
  public void Test1()
  {
      log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
      for (int i = 0; i < 3000; i++)
      {
          logger.ErrorFormat("test");
      }
  }

  See the attached VS2005 project for a complete example.

  One workaround I found is to do the following in the constructor:

  LogManager.GetRepository().Threshold = Level.Off;

  This seems a bit strange, because there is no logging visible in
  either case, yet it runs much slower without that line. Is this
  expected behaviour?



References