Re: Application Performance

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: John (john_at_nospam.infovis.co.uk)
Date: 04/19/04


Date: Mon, 19 Apr 2004 01:08:35 +0100

Hi Bill

Thanks for the info. Point taken. I will go through these and come back. In
the meanwhile I have just hit on a little short cut. The trick is to
actually open a connection, instead of just relying on the data adapters to
open/close connection. After that all data adapter actions seem to be much
faster on my standalone machine. I still need to test it on the client LAN
but I hope that performance increase will be reflected over there too.

Thanks

Regards

"William Ryan eMVP" <bill@NoSp4m.devbuzz.com> wrote in message
news:ukykY0ZJEHA.2452@TK2MSFTNGP09.phx.gbl...
> John:
>
> There could be a few things and you certainly have nothign to lose by
> updating your MDAC components altough I don't think they are the problem.
> I'm wondering about the design though.... Are you really using a
DataAdapter
> to bring over 1 record at a time? The comparison to Access is a lot
> different b/c it's using DAO (or one of those things) not ADO.NET.
However,
> using a DataAdapter/DataTable to bring over one record each time the user
> flips through something is ghastly...You definitely don't want to do this.
> There are many reasons why this is bad and even ifyou were using SQL
Server
> or Oracle, using these objects to do such light lifting is anthithetical
to
> the whole way ADO.NET is designed to perform. Instead, you'd want to grab
> your data, using a BindingContext for instace, use the locally cached data
> for whatever the user is doing, and send back the updates/inserts/deletes
at
> some interval dictated by business rules. You should keep trips to the DB
> to an Absolute minimum. So using a heavy object like a DataAdapter
coupled
> with a dataset/datatable alone to grab one record could be causing
> performance issues. I'd think Access was part of the problem but if it
> works within Access than it's not it.
>
> If you're accessing records one at a time (if you absolutely must hit
things
> one at a time, use a DataReader, but I'd still recommend against that),
you
> are going to be creating a ton of objects that you are throwing away
> quickly. Let's say that you move through 10 records. If you hit the db
> each time, that's a minimum of 10 connection objects, 10 command objects,
10
> DataTables unless you are reusing the stuff. Even if you are, then you
are
> still clearing that datatable a bunch and you are still firing 10 commands
> against the db when 1 would work. You can use SELECT, Compute etc on the
> Local DataTable and this should dramatically boost your performance. In
> addition to the data accesss issues, this approach wastes network
resources,
> strains the db and concievably costs Garbage Collections (also very
> expensive) that may otherwise not need to happen. How bad this is depends
> on how you are running those queries, but grabbing the data a piece at a
> time isn't the way to go, particularly with access.. can you post some of
> the code too? Also, you say that it doesn't always happen right? What
> tends to be the common denominator when it does? I'm thinking that the
> problem is both client and server (if I understand the scenario correctly,
> then there are almost certainly concerns on both ends) and the solution is
> going to be taking some pressure off of the db. This will lead to less
> locking, less stress on the db and a much more efficient streamlined app.
>
> Check out my articles on this and let me know if you're hitting the db one
> record at a time. If so, then it's good news b/c fixing this willl be
quite
> easy.
>
> http://www.knowdotnet.com/articles/dataviews1.html
> http://www.knowdotnet.com/articles/expressions.html
> http://www.knowdotnet.com/articles/adopartiii.html
>
> A friend of mine recently sold an Access app that did one at a time
queries
> and it definitely suffereed from some performance problems so we can
> definitely do a good bit of stuff to boost the performance.
>
> Let me know.
>
> Bill
> "John" <john@nospam.infovis.co.uk> wrote in message
> news:OOm6KHXJEHA.3436@tk2msftngp13.phx.gbl...
> > Hi
> >
> > I have this weird problem with my vb.net app that seems to have variable
> > performance and I can't seem to find out why. This vb.net app with
access
> 97
> > backend has a sister app in access 97 also with an access 97 backend.
Both
> > apps link some of each others tables. Now the problem is that access app
> > works fine even if there are 15 users on the same network/server but
> vb.net
> > app starts to get stuck even if 2-3 users have opened the app and only
one
> > is actually doing anything to test the app. Even this is just moving to
> the
> > next record which only brings one record at a time from server using
data
> > adapter/dataset. As no significant data activity is going on I suspect
it
> is
> > not data access issue. The machines are all new or newish dell winxp pro
> > machines (2.4 GHz etc.).
> >
> > - As the backend is access 97, could it be that vb.net tries to access
it
> as
> > access 2000 and possibly using the wrong data access dlls? Should I
> upgrade
> > back end databases to 2000? It does not happen all the time, though. I
> have
> > a feeling that if I open the access 97 app first then vb.net generally
> > behaves better.
> >
> > - Could optimistic/pessimistic locking on the server have anything to do
> > with this?
> >
> > - Anything to do with MDAC version of net framework sp? Anything on the
> > similar lines?
> >
> > - Any other possibilities that I can try?
> >
> > Thanks
> >
> > Regards
> >
> >
>
>



Relevant Pages

  • Re: Handling Ctrl-Break quickly and efficiently in a Windows GUI a
    ... but my app cannot accept input until this operation succeeds. ... imagine you hit the New Memo button in your e-mail ... my program is busy, I display the hourglass cursor and allow them to click ...
    (microsoft.public.win32.programmer.ui)
  • Re: iis limitations?
    ... > If every hit were a request for a simple HTML page, ... > for your App to do something. ... the page takes 2.5 seconds to execute on the server, with caching enabled, ...
    (microsoft.public.inetserver.iis)
  • Re: iis limitations?
    ... >> for your App to do something. ... >well, each hit is a request for my app to do something, I don't have simple ... >the page takes 2.5 seconds to execute on the server, with caching enabled, ...
    (microsoft.public.inetserver.iis)
  • Re: Intermittent configuration error
    ... > computer, connect to the same server, hit the same page and it will work ... These are very high traffic sites ... > if it's somehow related to how this app is loaded and cached (I don't know ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Persisting a Dataset
    ... I'm not sure you're going to get around the memory issue without possibly ... which would load the table into memory and serve all the exes. ... > I have a Windows Forms app deployed on Terminal Server. ... One of these datatables has about 5000 ...
    (microsoft.public.dotnet.framework.adonet)