J
JRD
Hi,
Thinking of the best way to develop a data acces layer for a new
program I have been doing some performance test.
My lab pilot is as follows:
SqlServer 2000 + VS2005 TS in the same machine.
Storage procedure returning 100.000 records from a table
-----------------------------------------------
DataTable dt = new DataTable();
ArticulosTableAdapter ta = new ArticulosTableAdapter();
SqlDataAdapter da = new
System.Data.SqlClient.SqlDataAdapter(sqlCommand);.
Connected Model:
-----------------------------
puno = Environment.TickCount;
sqlCommand.Connection.Open();
SqlDataReader sqlDim = sqlCommand.ExecuteReader();
dt.L.oad(sqlDim);
sqlDim.Close();
sqlCommand.Connection.Close();
time = TimeSpan.FromMilliseconds(Environment.TickCount -
puno);
Trace.Write("Load From DataReader Time-> ");
Trace.WriteLine(time);
Running:
Load From DataReader Time-> 00:00:02.3440000
Disconnected Model:
------------------------------------
1) TypedDataSet with DataAdapter
puno = Environment.TickCount;
da.Fill(_articulosDS);
time = TimeSpan.FromMilliseconds(Environment.TickCount -
puno);
Trace.Write("Typed DataSet With DataAdapter Time-> ");
Trace.WriteLine(time);
Running:
Typed DataSet With DataAdapter Time-> 00:00:00.5620000
2) TypedDataSet with TableAdapter
puno = Environment.TickCount;
ta.Fill(_articulosDS.Articulos);
time = TimeSpan.FromMilliseconds(Environment.TickCount -
puno);
Trace.Write("Typed DataSet With TableAdapter Time-> ");
Trace.WriteLine(time);
Running:
Typed DataSet With TableAdapter Time-> 00:00:02.6250000
I understand that filling a DataTable with a DataReader is a time
consuming process that will take 2,34 secs for 100.000 records, but I
do not understand why Filling a TableAdapter I am getting poor
performance (3 times less) than Filling a DataAdapter.
Any Idea ?
Thank you
José Ramón
Thinking of the best way to develop a data acces layer for a new
program I have been doing some performance test.
My lab pilot is as follows:
SqlServer 2000 + VS2005 TS in the same machine.
Storage procedure returning 100.000 records from a table
-----------------------------------------------
DataTable dt = new DataTable();
ArticulosTableAdapter ta = new ArticulosTableAdapter();
SqlDataAdapter da = new
System.Data.SqlClient.SqlDataAdapter(sqlCommand);.
Connected Model:
-----------------------------
puno = Environment.TickCount;
sqlCommand.Connection.Open();
SqlDataReader sqlDim = sqlCommand.ExecuteReader();
dt.L.oad(sqlDim);
sqlDim.Close();
sqlCommand.Connection.Close();
time = TimeSpan.FromMilliseconds(Environment.TickCount -
puno);
Trace.Write("Load From DataReader Time-> ");
Trace.WriteLine(time);
Running:
Load From DataReader Time-> 00:00:02.3440000
Disconnected Model:
------------------------------------
1) TypedDataSet with DataAdapter
puno = Environment.TickCount;
da.Fill(_articulosDS);
time = TimeSpan.FromMilliseconds(Environment.TickCount -
puno);
Trace.Write("Typed DataSet With DataAdapter Time-> ");
Trace.WriteLine(time);
Running:
Typed DataSet With DataAdapter Time-> 00:00:00.5620000
2) TypedDataSet with TableAdapter
puno = Environment.TickCount;
ta.Fill(_articulosDS.Articulos);
time = TimeSpan.FromMilliseconds(Environment.TickCount -
puno);
Trace.Write("Typed DataSet With TableAdapter Time-> ");
Trace.WriteLine(time);
Running:
Typed DataSet With TableAdapter Time-> 00:00:02.6250000
I understand that filling a DataTable with a DataReader is a time
consuming process that will take 2,34 secs for 100.000 records, but I
do not understand why Filling a TableAdapter I am getting poor
performance (3 times less) than Filling a DataAdapter.
Any Idea ?
Thank you
José Ramón