Click here to Skip to main content
16,015,583 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to Insert more than one row in a single click using stored procedure Pin
Simon P Stevens6-Jun-08 0:13
Simon P Stevens6-Jun-08 0:13 
AnswerRe: How to Insert more than one row in a single click using stored procedure Pin
Ashfield6-Jun-08 3:22
Ashfield6-Jun-08 3:22 
GeneralRe: How to Insert more than one row in a single click using stored procedure Pin
Giorgi Dalakishvili6-Jun-08 5:01
mentorGiorgi Dalakishvili6-Jun-08 5:01 
QuestionHow to know which version of Oracle client is used by the .Net? Pin
nicolus5-Jun-08 22:44
nicolus5-Jun-08 22:44 
QuestionHow to add multiple sort fields on crystal reports in my application Pin
combo_ci5-Jun-08 22:25
combo_ci5-Jun-08 22:25 
QuestionCalling native C++ from .net - code suggestion for my code Pin
steve_rm5-Jun-08 22:07
steve_rm5-Jun-08 22:07 
QuestionC# io question Pin
poqeqw5-Jun-08 21:42
poqeqw5-Jun-08 21:42 
AnswerRe: C# io question Pin
Simon P Stevens6-Jun-08 0:31
Simon P Stevens6-Jun-08 0:31 
poqeqw wrote:
waht should i do in order to achive max performance?


The limiting factor here is probably the drive speed. Getting the data into RAM is what is going to take the longest. simply XORing the data is insignificant in comparison to how long it will take to load/save the data, so don't mess around with separate threads for processing the data, you'll be wasting your time.

you can use System.IO.File.ReadAllBytes(@"C:\myfile"); to get the whole file. and System.IO.File.WriteAllBytes(@"c;\myfile", thedata); to save the processed data. I'd start by doing it like this. Stick some timers in a time how long the load takes, how long the save take and how long the processing takes. There is nothing you can do to speed up the load/save (apart from buy faster drives).

However, if the processing time is significant, you could start the processing while still loading the file. You could do this by doing the read on a seperate thread like this:
System.IO.FileStream myStream = new System.IO.FileStream(@"c;\myfile", System.IO.FileAccess.Read);
myStream.BeginRead(...);


and allowing the main thread to start processing while the read is still taking place. You'll have to put checks in place to make sure the main thread doesn't get ahead of the data being read.

(Don't bother using threads to do several files at the same time, the drive will only thrash about and read time will actually be slower. focus on doing them sequentially. Remember the limiting factor here is almost certainly the drive access. Unless of course they are on separate drives, or you are doing some really heavy cpu intensive processing)

Simon

QuestionScheduled download Pin
Rijz5-Jun-08 21:10
Rijz5-Jun-08 21:10 
AnswerRe: Scheduled download Pin
Vikram A Punathambekar5-Jun-08 22:47
Vikram A Punathambekar5-Jun-08 22:47 
GeneralRe: Scheduled download Pin
RaviBattula5-Jun-08 23:48
professionalRaviBattula5-Jun-08 23:48 
QuestionXQuery Pin
George_George5-Jun-08 21:02
George_George5-Jun-08 21:02 
AnswerRe: XQuery Pin
N a v a n e e t h5-Jun-08 21:18
N a v a n e e t h5-Jun-08 21:18 
GeneralRe: XQuery Pin
George_George5-Jun-08 21:22
George_George5-Jun-08 21:22 
GeneralRe: XQuery Pin
N a v a n e e t h5-Jun-08 22:14
N a v a n e e t h5-Jun-08 22:14 
GeneralRe: XQuery Pin
George_George5-Jun-08 22:30
George_George5-Jun-08 22:30 
Questioninfragistics Ultragrid Pin
Member 31169975-Jun-08 20:30
Member 31169975-Jun-08 20:30 
AnswerRe: infragistics Ultragrid Pin
Pete O'Hanlon5-Jun-08 22:07
mvePete O'Hanlon5-Jun-08 22:07 
GeneralRe: infragistics Ultragrid Pin
Colin Angus Mackay5-Jun-08 22:48
Colin Angus Mackay5-Jun-08 22:48 
GeneralRe: infragistics Ultragrid Pin
Pete O'Hanlon6-Jun-08 1:12
mvePete O'Hanlon6-Jun-08 1:12 
QuestionCannot insert duplicate key row in object Pin
Ballita5-Jun-08 18:54
Ballita5-Jun-08 18:54 
AnswerRe: Cannot insert duplicate key row in object Pin
dealon5-Jun-08 20:25
dealon5-Jun-08 20:25 
AnswerRe: Cannot insert duplicate key row in object - DUPLICATE POST Pin
Ashfield5-Jun-08 21:09
Ashfield5-Jun-08 21:09 
QuestionHashtable v.s. Dictionary Pin
George_George5-Jun-08 16:56
George_George5-Jun-08 16:56 
AnswerRe: Hashtable v.s. Dictionary Pin
PIEBALDconsult5-Jun-08 16:58
mvePIEBALDconsult5-Jun-08 16:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.