Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Speed of SqlDataReader vs SqlDataAdapter/DataSet

Posted on 2006-06-15
4
Medium Priority
?
1,020 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 252 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 248 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

604 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