Click here to Skip to main content
14,304,866 members

C / C++ / MFC

 
GeneralRe: _findfirst and fopen very slow Pin
Stefan_Lang1-Feb-19 4:59
memberStefan_Lang1-Feb-19 4:59 
GeneralRe: _findfirst and fopen very slow Pin
cristiapi1-Feb-19 5:44
membercristiapi1-Feb-19 5:44 
GeneralRe: _findfirst and fopen very slow Pin
cristiapi1-Feb-19 6:24
membercristiapi1-Feb-19 6:24 
GeneralRe: _findfirst and fopen very slow Pin
leon de boer1-Feb-19 21:40
memberleon de boer1-Feb-19 21:40 
GeneralRe: _findfirst and fopen very slow Pin
cristiapi1-Feb-19 23:35
membercristiapi1-Feb-19 23:35 
GeneralRe: _findfirst and fopen very slow Pin
leon de boer2-Feb-19 0:33
memberleon de boer2-Feb-19 0:33 
AnswerRe: _findfirst and fopen very slow Pin
Stefan_Lang31-Jan-19 21:27
memberStefan_Lang31-Jan-19 21:27 
AnswerRe: _findfirst and fopen very slow Pin
Joe Woodbury1-Feb-19 5:36
professionalJoe Woodbury1-Feb-19 5:36 
The main culprit is "fgets". Once you call that, the fopen series of calls immediately loads, I believe, 32k of data. On top of that fgets is relatively slow. For speed, you may be better off using fread, reading in 4k (or the page size) at a time and parsing the block yourself (by simply looking for ABCD. This could be sped up faster by doing a Boyer-Moore search, though since the string is short, simply scanning first for A and then checking for the rest may be faster. That said, I believe some new implementations of the standard library now include a Boyer-Moore algorithm.)

Do also note that caching plays a big part here. Just recursing folders will take significantly longer the first pass than the second. This can be deceptive, however, since in actual operation those caches may be flushed between program runs.
AnswerRe: _findfirst and fopen very slow Pin
cristiapi2-Feb-19 1:13
membercristiapi2-Feb-19 1:13 
Questionwrite in .xlsx extension excel file using c++ Pin
Member 1413460229-Jan-19 23:49
memberMember 1413460229-Jan-19 23:49 
AnswerRe: write in .xlsx extension excel file using c++ Pin
Richard MacCutchan29-Jan-19 23:52
protectorRichard MacCutchan29-Jan-19 23:52 
AnswerRe: write in .xlsx extension excel file using c++ Pin
leon de boer30-Jan-19 2:09
memberleon de boer30-Jan-19 2:09 
RantC++ Typedefs Pin
nitrous_00729-Jan-19 4:45
membernitrous_00729-Jan-19 4:45 
GeneralRe: C++ Typedefs Pin
Richard MacCutchan29-Jan-19 5:41
protectorRichard MacCutchan29-Jan-19 5:41 
GeneralRe: C++ Typedefs Pin
David Crow29-Jan-19 6:20
memberDavid Crow29-Jan-19 6:20 
GeneralRe: C++ Typedefs Pin
Joe Woodbury29-Jan-19 9:45
professionalJoe Woodbury29-Jan-19 9:45 
GeneralRe: C++ Typedefs Pin
CPallini29-Jan-19 10:35
mveCPallini29-Jan-19 10:35 
GeneralRe: C++ Typedefs Pin
Stefan_Lang29-Jan-19 21:16
memberStefan_Lang29-Jan-19 21:16 
GeneralRe: C++ Typedefs Pin
leon de boer30-Jan-19 3:20
memberleon de boer30-Jan-19 3:20 
QuestionWhere do you place your #includes? Pin
den2k8828-Jan-19 23:49
professionalden2k8828-Jan-19 23:49 
AnswerRe: Where do you place your #includes? Pin
Daniel Pfeffer29-Jan-19 0:32
professionalDaniel Pfeffer29-Jan-19 0:32 
GeneralRe: Where do you place your #includes? Pin
den2k8829-Jan-19 21:12
professionalden2k8829-Jan-19 21:12 
AnswerRe: Where do you place your #includes? Pin
speedbump9929-Jan-19 2:27
memberspeedbump9929-Jan-19 2:27 
GeneralRe: Where do you place your #includes? Pin
den2k8829-Jan-19 21:10
professionalden2k8829-Jan-19 21:10 
GeneralRe: Where do you place your #includes? Pin
Klaus-Werner Konrad24-Apr-19 4:31
memberKlaus-Werner Konrad24-Apr-19 4:31 

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.