简体   繁体   中英

Oracle ODP.NET Managed Driver running 50-100% slower in 64bit than in 32bit

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?

简单的答案是获取两个套件的ETW跟踪并使用wpa / PerfView等工具进行分析。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM