Performance comparison ODP.NET (managed) vs Devart direct
Posted: Tue 03 Jan 2017 16:00
Hello,
we use the devart provider many years now in direct mode. Years ago there was no other (good) solution connection to oracle without installing a client. Today oracle has its own managed ODP.NET provider so we made some performance comparison selecting data from a big wide table (270 columns).
The code is the same for Devart and ODP:
var conn = GetConnection();
conn.Open();
var comm = new OracleCommand(iSql);
comm.Connection = conn;
var watch = Stopwatch.StartNew();
OracleDataReader dr = comm.ExecuteReader();
while (dr.Read()) {}
watch.Stop();
conn.Close();
When using this sample devart seems to be faster than ODP. In ODP I now can set the FetchSize of the OracleDataReader which increases the performance dramatically.
var conn = GetConnection();
conn.Open();
var comm = new OracleCommand(iSql);
comm.Connection = conn;
var watch = Stopwatch.StartNew();
OracleDataReader dr = comm.ExecuteReader();
dr.FetchSize = dr.RowSize * 1000;
while (dr.Read()) {}
watch.Stop();
conn.Close();
If I add the bold row above the ODP select is much faster than Devart. Here are the times:
Devart
1 row: 3 ms
35 rows: 7 ms
400 rows: 82 ms
1200 rows: 113 ms
8000 rows: 687 ms
ODP.NET
1 row: 1 ms
35 rows: 2 ms
400 rows: 13 ms
1200 rows: 20 ms
8000 rows: 220 ms
I tried setting the FetchSize at the OracleCommand for Devart but without any changes. Is there anything I can do to get similar performance to the ODP?
Devart: 9.2.172
ODP: 4.121.2.0
we use the devart provider many years now in direct mode. Years ago there was no other (good) solution connection to oracle without installing a client. Today oracle has its own managed ODP.NET provider so we made some performance comparison selecting data from a big wide table (270 columns).
The code is the same for Devart and ODP:
var conn = GetConnection();
conn.Open();
var comm = new OracleCommand(iSql);
comm.Connection = conn;
var watch = Stopwatch.StartNew();
OracleDataReader dr = comm.ExecuteReader();
while (dr.Read()) {}
watch.Stop();
conn.Close();
When using this sample devart seems to be faster than ODP. In ODP I now can set the FetchSize of the OracleDataReader which increases the performance dramatically.
var conn = GetConnection();
conn.Open();
var comm = new OracleCommand(iSql);
comm.Connection = conn;
var watch = Stopwatch.StartNew();
OracleDataReader dr = comm.ExecuteReader();
dr.FetchSize = dr.RowSize * 1000;
while (dr.Read()) {}
watch.Stop();
conn.Close();
If I add the bold row above the ODP select is much faster than Devart. Here are the times:
Devart
1 row: 3 ms
35 rows: 7 ms
400 rows: 82 ms
1200 rows: 113 ms
8000 rows: 687 ms
ODP.NET
1 row: 1 ms
35 rows: 2 ms
400 rows: 13 ms
1200 rows: 20 ms
8000 rows: 220 ms
I tried setting the FetchSize at the OracleCommand for Devart but without any changes. Is there anything I can do to get similar performance to the ODP?
Devart: 9.2.172
ODP: 4.121.2.0