473,320 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Performance tweak

Jon
Hello all,

I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:

this.OnFillParameters(selectCommand);

SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);

try
{
selectAdapter.Fill(resultsDataSet);
......
Does anyone have any suggestions/pointers on how this could be improved.

Any comments welcomed.

Thanks,

JY
Oct 5 '06 #1
7 1384
hi,

sorry what do you mean by bottle neck?
Jon wrote:
Hello all,

I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:

this.OnFillParameters(selectCommand);

SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);

try
{
selectAdapter.Fill(resultsDataSet);
.....
Does anyone have any suggestions/pointers on how this could be improved.

Any comments welcomed.

Thanks,

JY
Oct 5 '06 #2
Jon
Hi,

My apologies, I shouldn't use local terms on international forums! :)

By bottle next I mean an area of the application that is the slowest.

Thanks,

Jon

"Varangian" wrote:
hi,

sorry what do you mean by bottle neck?
Jon wrote:
Hello all,

I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:

this.OnFillParameters(selectCommand);

SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);

try
{
selectAdapter.Fill(resultsDataSet);
.....
Does anyone have any suggestions/pointers on how this could be improved.

Any comments welcomed.

Thanks,

JY

Oct 5 '06 #3
Hi Jon,

BottleNeck is a common technical term, so don't sweat it!

You've got some pretty simple code there. How many records does it fetch?

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

If the Truth hurts, wear it.

"Jon" <Jo*@discussions.microsoft.comwrote in message
news:23**********************************@microsof t.com...
Hi,

My apologies, I shouldn't use local terms on international forums! :)

By bottle next I mean an area of the application that is the slowest.

Thanks,

Jon

"Varangian" wrote:
>hi,

sorry what do you mean by bottle neck?
Jon wrote:
Hello all,

I've been doing some performance analysis on our app, and I've
discovered
that the below code is quite a bottle neck:

this.OnFillParameters(selectCommand);

SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);

try
{
selectAdapter.Fill(resultsDataSet);
.....
Does anyone have any suggestions/pointers on how this could be
improved.

Any comments welcomed.

Thanks,

JY


Oct 5 '06 #4
Unless you're calling that code inside a loop, I can't see that it's
going to cause performance problems. You can always use a SqlDataReader
directly if you want the fastest access to your data but, in all
likelyhood, the performance problem lies with your database query.
Jon wrote:
Hi,

My apologies, I shouldn't use local terms on international forums! :)

By bottle next I mean an area of the application that is the slowest.

Thanks,

Jon

"Varangian" wrote:
hi,

sorry what do you mean by bottle neck?
Jon wrote:
Hello all,
>
I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:
>
this.OnFillParameters(selectCommand);
>
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
>
try
{
selectAdapter.Fill(resultsDataSet);
.....
>
>
Does anyone have any suggestions/pointers on how this could be improved.
>
Any comments welcomed.
>
Thanks,
>
JY
Oct 5 '06 #5
Jon
Hi Kevin and thanks for the reply.

The SP returns varying amounts of data, but even for say 100 records, it's
slow. I do know that the Database and SP's need to be looked at, for example,
if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values from
the first SP (you get the idea!).

But I'd prefer to start with the C# code, as it's less of a beast, and more
my domain. The DB has other issues, I'm really just trying to quel the fire
so to speak.

I was thinking of using the MS DAB, not the June 2005 release. Would that be
better? I'm really just looking for some advice / help.

Thanks again,

Jon

"Kevin Spencer" wrote:
Hi Jon,

BottleNeck is a common technical term, so don't sweat it!

You've got some pretty simple code there. How many records does it fetch?

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

If the Truth hurts, wear it.

"Jon" <Jo*@discussions.microsoft.comwrote in message
news:23**********************************@microsof t.com...
Hi,

My apologies, I shouldn't use local terms on international forums! :)

By bottle next I mean an area of the application that is the slowest.

Thanks,

Jon

"Varangian" wrote:
hi,

sorry what do you mean by bottle neck?
Jon wrote:
Hello all,

I've been doing some performance analysis on our app, and I've
discovered
that the below code is quite a bottle neck:

this.OnFillParameters(selectCommand);

SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);

try
{
selectAdapter.Fill(resultsDataSet);
.....
Does anyone have any suggestions/pointers on how this could be
improved.

Any comments welcomed.

Thanks,

JY



Oct 5 '06 #6
The first thing you should do, if you can, is look at the execution of
your procedure in Sql Query Analyzer and see how much of the time spent
in that block is accounted for by SQL server. Without knowing the
numbers, you can't optimise usefully.

There's not much code there to optimise. It isn't teh uber-leet h4x0r
fastest way of doing DB access, but the difference between that and
other methods is going to be minimal.

If that code is running slowly, I would place hard-earned money on the
issue being time spent inside Sql server. I don't honestly think you
will make any measurable dent on your performance problem by tweaking
that code.

Of course, if I'm wrong, I want to know about it, so let people know
what you find out in any case.

-- Bob Gregory
Unvalued Professional.

Jon wrote:
Hi Kevin and thanks for the reply.

The SP returns varying amounts of data, but even for say 100 records, it's
slow. I do know that the Database and SP's need to be looked at, for example,
if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values from
the first SP (you get the idea!).

But I'd prefer to start with the C# code, as it's less of a beast, and more
my domain. The DB has other issues, I'm really just trying to quel the fire
so to speak.

I was thinking of using the MS DAB, not the June 2005 release. Would that be
better? I'm really just looking for some advice / help.

Thanks again,

Jon

"Kevin Spencer" wrote:
Hi Jon,

BottleNeck is a common technical term, so don't sweat it!

You've got some pretty simple code there. How many records does it fetch?

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

If the Truth hurts, wear it.

"Jon" <Jo*@discussions.microsoft.comwrote in message
news:23**********************************@microsof t.com...
Hi,
>
My apologies, I shouldn't use local terms on international forums! :)
>
By bottle next I mean an area of the application that is the slowest.
>
Thanks,
>
Jon
>
"Varangian" wrote:
>
>hi,
>>
>sorry what do you mean by bottle neck?
>>
>>
>Jon wrote:
Hello all,
>
I've been doing some performance analysis on our app, and I've
discovered
that the below code is quite a bottle neck:
>
this.OnFillParameters(selectCommand);
>
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
>
try
{
selectAdapter.Fill(resultsDataSet);
.....
>
>
Does anyone have any suggestions/pointers on how this could be
improved.
>
Any comments welcomed.
>
Thanks,
>
JY
>>
>>
Oct 5 '06 #7
Hi Jon,

You're correct about optimizing the stored procedures, which I can't really
say anything about. As for your code, yes, it could be optimized, depending
upon your requirements. For example, it sounds like you're simply fetching a
single set of data, or a single DataTable. But you're using a DataSet, which
is a rather large and complex class that mimics a database in many ways,
holding numerous DataTables, handling relationships, etc. One optimization
would be to simply use a DataTable with a SqlDataReader. The SqlDataReader
is a very fast little class (which is actually used by a SqlDataAdapter to
do the work that it does in filling DataTables and DataSets). You can fetch
the data with the SqlDataReader, and then pass it as a parameter to the
DataTable.Load method. See
http://msdn2.microsoft.com/en-us/lib...able.load.aspx for
more details, and good luck!

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

If the Truth hurts, wear it.

"Jon" <Jo*@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.com...
Hi Kevin and thanks for the reply.

The SP returns varying amounts of data, but even for say 100 records, it's
slow. I do know that the Database and SP's need to be looked at, for
example,
if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values
from
the first SP (you get the idea!).

But I'd prefer to start with the C# code, as it's less of a beast, and
more
my domain. The DB has other issues, I'm really just trying to quel the
fire
so to speak.

I was thinking of using the MS DAB, not the June 2005 release. Would that
be
better? I'm really just looking for some advice / help.

Thanks again,

Jon

"Kevin Spencer" wrote:
>Hi Jon,

BottleNeck is a common technical term, so don't sweat it!

You've got some pretty simple code there. How many records does it fetch?

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

If the Truth hurts, wear it.

"Jon" <Jo*@discussions.microsoft.comwrote in message
news:23**********************************@microso ft.com...
Hi,

My apologies, I shouldn't use local terms on international forums! :)

By bottle next I mean an area of the application that is the slowest.

Thanks,

Jon

"Varangian" wrote:

hi,

sorry what do you mean by bottle neck?
Jon wrote:
Hello all,

I've been doing some performance analysis on our app, and I've
discovered
that the below code is quite a bottle neck:

this.OnFillParameters(selectCommand);

SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);

try
{
selectAdapter.Fill(resultsDataSet);
.....
Does anyone have any suggestions/pointers on how this could be
improved.

Any comments welcomed.

Thanks,

JY




Oct 5 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andy Tran | last post by:
I built a system using mysql innodb to archive SMS messages but the innodb databases are not keeping up with the number of SMS messages coming in. I'm looking for performance of 200 msgs/sec where...
6
by: teedilo | last post by:
We have an application with a SQL Server 2000 back end that is fairly database intensive -- lots of fairly frequent queries, inserts, updates -- the gamut. The application does not make use of...
115
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical...
16
by: tweak | last post by:
When should malloc() and related functions (e.g. calloc(), realloc() ) be used? I keep hearing to keep stuff out of memory as much as possible since it's not as fast as when stuff is in the...
13
by: bjarne | last post by:
Willy Denoyette wrote; > ... it > was not the intention of StrousTrup to the achieve the level of efficiency > of C when he invented C++, ... Ahmmm. It was my aim to match the performance...
2
by: Aditya | last post by:
Hi! I am currently trying to upgrade to the nant 0.84 and was successful in making the necessary changes. I am having a performance issue though. Whenever I have a reference of the form A.D.dll,...
8
by: Dmitry Akselrod | last post by:
Hi, I have a recursive application that walks through a directory structure on a Hard Drive and writes various file information to a single table in an Access 2003 database. I am opening a...
4
by: Jim Devenish | last post by:
I have converted an Access back-end to SQL Server back-end but am having some problems. The Access to Access application has been running well for some years. I have successfully copied all the...
5
by: Markus Ernst | last post by:
Hello A class that composes the output of shop-related data gets some info from the main shop class. Now I wonder whether it is faster to store the info in the output class or get it from the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.