Re: Bad Performance In C# Project
From: Miha Markic [MVP C#] (miha)
Date: 03/01/04
- Next message: Miha Markic [MVP C#]: "Re: error in from clause"
- Previous message: Roel Van den Brande: "Re: error in from clause"
- In reply to: aculfa: "Re: Bad Performance In C# Project"
- Next in thread: Jeff Davis: "Re: Bad Performance In C# Project"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 1 Mar 2004 14:32:25 +0100
Hi,
I see.
Try invoking GC.Collect; GC.WaitForPendingFinalizers after each update (when
there is no reference to dataset anymore)- it will force garbage collector
to do its work.
Just for test.
-- Miha Markic [MVP C#] - RightHand .NET consulting & software development miha at rthand com www.rthand.com "aculfa" <a.culfa@belbim.com.tr> wrote in message news:uushME5$DHA.3536@tk2msftngp13.phx.gbl... > This is somehow like a bulk insert project. > > 6 clients get files to their local from file server, process them and > inserts data to DB. > > Instead reading and updating database, I thought to process all at once, and > then to update each table to DB. > > I think after a while GC starts to clear "typed datasets" from memory, which > belong to previous files. And the program slows down. > > Here's a results I saw: > 1st file: Completed in 21 seconds > 2nd file: Completed in 25 seconds > 3rd file: Completed in 30 seconds > 4th file: Completed in 41 seconds > 5th file: Completed in 50 seconds > 6th file: Completed in 1min 40sec seconds > > and the other are in the 2-3 minute range. > > My opinion is that the destruction of typed dataset's in the memory takes > long, and between 5th and 6th steps GC starts collecting. > > If so, is there a faster way that I can get rid of older datasets and begin > the latter file with clean memory? > If not, why does the program slows down. > > (Files are similar, each at similar size, and produces about 10000 rows of > data.) > > > > > "Miha Markic [MVP C#]" <miha at rthand com>, iletide şunu yazdı > news:ObbOQs2$DHA.1464@tk2msftngp13.phx.gbl... > > Hi aculfa, > > > > The fastest way is to do the processing on the server. > > But anyway, what exactly is slow? > > > > -- > > Miha Markic [MVP C#] - RightHand .NET consulting & software development > > miha at rthand com > > www.rthand.com > > > > "aculfa" <a.culfa@belbim.com.tr> wrote in message > > news:ucQVeQ2$DHA.2036@TK2MSFTNGP12.phx.gbl... > > > I've just finished a C# project that processes a file and inserts data > to > > > database. > > > > > > I used "typed dataset" and filled tables in this dataset during file > > > process. After processing, data sent to DB by using DataAdapter.Update. > > > > > > First few files are done very fast, but later on it slows down. > > > > > > For performance, I tried to do everything in memory. But I should > mention > > > that after a file process there may be a total data at about 50000rows > in > > > memory and destruction of these tables are left to Garbage Collector. > > > > > > Is this a bad way? If so, what should I do to increase performance. > > > > > > Note: For first 5 files, it's twice as fast as Delphi does, but after > 100 > > > files it's twice as slow. > > > > > > > > > > > > > > >
- Next message: Miha Markic [MVP C#]: "Re: error in from clause"
- Previous message: Roel Van den Brande: "Re: error in from clause"
- In reply to: aculfa: "Re: Bad Performance In C# Project"
- Next in thread: Jeff Davis: "Re: Bad Performance In C# Project"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|