Click here to Skip to main content
15,888,802 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Question on performance... Pin
Sander Rossel16-Oct-22 3:57
professionalSander Rossel16-Oct-22 3:57 
GeneralRe: Question on performance... Pin
Jörgen Andersson16-Oct-22 21:11
professionalJörgen Andersson16-Oct-22 21:11 
GeneralRe: Question on performance... Pin
Sander Rossel16-Oct-22 23:23
professionalSander Rossel16-Oct-22 23:23 
GeneralRe: Question on performance... Pin
Jörgen Andersson17-Oct-22 0:43
professionalJörgen Andersson17-Oct-22 0:43 
GeneralRe: Question on performance... Pin
Sander Rossel17-Oct-22 9:49
professionalSander Rossel17-Oct-22 9:49 
GeneralRe: Question on performance... Pin
Ian Fitzgerald19-Oct-22 7:32
Ian Fitzgerald19-Oct-22 7:32 
GeneralRe: Question on performance... Pin
Sander Rossel20-Oct-22 1:09
professionalSander Rossel20-Oct-22 1:09 
GeneralRe: Question on performance... Pin
harold aptroot16-Oct-22 2:49
harold aptroot16-Oct-22 2:49 
Inspired by this question, I went to take a more detailed look at where the time to load a 1.2 million line, 0.5 gigabyte, CSV file goes in a particular application that I'm working on. That process takes about 5 seconds too, by some coincidence.

There are three steps: reading the file (all at once), converting the encoding, and parsing the CSV into objects.
  • reading the file (File.ReadAllBytes) takes about 150 milliseconds. (so we're reading the file at 3.3GB/s, which is reasonable, near the maximum sequential read speed of the SSD)
  • converting the encoding (aka Encoding.GetString) takes about 900 milliseconds. (at 5GHz, this comes down to 9 cycles per byte, should it take 9 cycles per byte to do encoding conversion? sounds slow to me)
  • parsing / creating objects takes the rest of the time. (this code is crap and takes at least 10 times as long as it should)
There's no database involved. Loading 2k rows in the same time basically comes down to saying that using a database makes loading the data over 500 times as slow - compared to code that is slow already. Is that reasonable? Databases are infamous for being pure molasses, but that sounds extreme.

On the other hand, it's only 5 seconds, not a big deal.
GeneralRe: Question on performance... Pin
Sander Rossel16-Oct-22 4:03
professionalSander Rossel16-Oct-22 4:03 
AnswerRe: Question on performance... Pin
Marc Clifton16-Oct-22 4:05
mvaMarc Clifton16-Oct-22 4:05 
GeneralRe: Question on performance... Pin
Sander Rossel16-Oct-22 8:22
professionalSander Rossel16-Oct-22 8:22 
GeneralRe: Question on performance... Pin
Marc Clifton17-Oct-22 5:43
mvaMarc Clifton17-Oct-22 5:43 
AnswerRe: Question on performance... Pin
raddevus16-Oct-22 5:13
mvaraddevus16-Oct-22 5:13 
GeneralRe: Question on performance... Pin
Sander Rossel16-Oct-22 8:20
professionalSander Rossel16-Oct-22 8:20 
AnswerRe: Question on performance... Pin
abmv16-Oct-22 5:19
professionalabmv16-Oct-22 5:19 
AnswerRe: Question on performance... Pin
Cpichols17-Oct-22 1:32
Cpichols17-Oct-22 1:32 
AnswerRe: Question on performance... Pin
charlieg17-Oct-22 2:27
charlieg17-Oct-22 2:27 
AnswerRe: Question on performance... Pin
MikeCO1017-Oct-22 3:03
MikeCO1017-Oct-22 3:03 
AnswerRe: Question on performance... Pin
Max Santos17-Oct-22 3:47
Max Santos17-Oct-22 3:47 
AnswerRe: Question on performance... Pin
GuyThiebaut17-Oct-22 5:54
professionalGuyThiebaut17-Oct-22 5:54 
AnswerRe: Question on performance... Pin
WildlingCoder17-Oct-22 6:38
professionalWildlingCoder17-Oct-22 6:38 
AnswerRe: Question on performance... Pin
JasonSQ17-Oct-22 8:44
JasonSQ17-Oct-22 8:44 
AnswerRe: Question on performance... Pin
englebart17-Oct-22 17:02
professionalenglebart17-Oct-22 17:02 
Generalworldle 267 Pin
jmaida15-Oct-22 8:59
jmaida15-Oct-22 8:59 
GeneralWordle 484 Pin
Vivi Chellappa15-Oct-22 8:41
professionalVivi Chellappa15-Oct-22 8:41 

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.