nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #02426
[Bug 761579] Re: Tests using log4net run very slowly
** Changed in: nunitv2
Assignee: (unassigned) => Charlie Poole (charlie.poole)
--
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?
To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/761579/+subscriptions
References