Solved

Speed of SqlDataReader vs SqlDataAdapter/DataSet

Posted on 2006-06-15
4
985 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

756 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