5

I just switched some NUnit test projects from x86 to AnyCPU and started to run them in 64bit runtime using nunit-console.exe instead of nunit-console-x86.exe. This resulted in some 50-100% longer test duration to my great surprise. I can easily simulate it repeatedly on any of the test assemblies and even profiled the test runs, but I'm not able to figure out what's causing the performance penalty, because just everything seems to perform slower in 64bits. I also tried to run the tests on few different machines with same results.

Test assemblies are using Spring.NET IOC and Oracle ODP managed provider (this was the reason behind switching tests from x86 to AnyCPU) to perform integration tests. The only difference in test runs is really the 32 vs 64bit environment or nunit executable (nunit-console-x86.exe vs nunit-console.exe) respectively.

Is there any general reason for such a big test duration difference? Or does anyone have an idea what should I check to find out the cause of the issue?


Follow up:

The problem is caused by Oracle ODP.NET Managed Driver released this august (version 121010 or 4.121.1.0). It apparently has many performance issues and one of them is 64bit performance penalty. I got duration around 0.6s when running following code under 32bit environment and around 1.5s when running under 64bit:

        var sw = Stopwatch.StartNew();
        using (var conn = new OracleConnection(ConnectionString))
        {
            conn.Open();

            for (var i = 0; i < 100; i++)
            {
                using (var cmd = conn.CreateCommand())
                {
                    cmd.CommandText = "select sysdate from dual";
                    var result = Convert.ToDateTime(cmd.ExecuteScalar());
                }
            }
        }

        Console.Out.WriteLine(sw.Elapsed);

Now is there any trick how to get acceptable performance out of Oracle ODP.NET Managed driver or is it just not production ready yet even though Oracle claims it to be "final" release? Do I have any other option except going back to native ODP.NET provider?

Huseyin Yagli
  • 9,896
  • 6
  • 41
  • 50
Buthrakaur
  • 1,821
  • 3
  • 23
  • 35
  • Are both the tests and the projects you are testing configured to build as 64 bit? – Kjartan Oct 21 '13 at 13:21
  • All the projects are AnyCPU. – Buthrakaur Oct 21 '13 at 13:28
  • The simple explanation is that the code you are testing is just that much slower. You can't ask us why it is slower, we don't know what it looks like. You need to ask a *profiler*. – Hans Passant Oct 21 '13 at 13:38
  • @HansPassant Yes - you're right. I hoped someone has already faced similar situation with technologies I mentioned. I'm currently profiling some specific tests and it looks like the Oracle managed provider is the main cause. Will report back any progress.. – Buthrakaur Oct 21 '13 at 13:47
  • 7
    Oracle has a different definition of "Production Ready" than most software companies. – Charles Burns Dec 06 '13 at 18:35

1 Answers1

0

The simple answer is get ETW traces for both cased and analyze them using tools like wpa/PerfView.