Solved

Speed of SqlDataReader vs SqlDataAdapter/DataSet

Posted on 2006-06-15
4
976 Views
Last Modified: 2008-02-01
Has anyone done research/testing on using SqlDataReader vs SqlDataReader in C++.net?  I am just curious. I wrote code in C++.net thinking it would be faster than vb.net code. My testing shows that vb.net is just as fast for grabbing data from sql, doing a bit of math and updating sql. I thought it would be faster in C++.net, but it is managed code. I am using SQLDataReader in C++.
Thanks for any input!
Pam
0
Comment
Question by:pamwestphal
4 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 63 total points
ID: 16914158
They should both be the same as they will, for the most part, compile to precisely the same IL code.

Unmanaged C++ should be faster than equivalent .Net code, but there shouldn't be much difference (if any) in speed for managed languages.
0
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 62 total points
ID: 16937160
Without doing any actual research, I can opine that the throughput bottleneck is nearly always the database access itself, rather than the code that wraps that access.  If you write "to the metal" -- direct access to the database drivers you might see a few % speed increase.  Otherwise, the performance will be very similar.

Anything that DOT NET does (or ADO or ODBC layer does) will burn a few CPU cycles, but the bulk of the data access time will be time spent by the DBMS driver in table scans to filter the recordset and to satisfy the SELECT statement and in I/O time spent transfering that data to your program.

Such things as a well-thought-out indexing strategy and selective record fetching will make much more difference in the overall speed of your database-intensive program than the specific tool you use to access the database.

-- Dan
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now