Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Performance problem with my FindOneOf function Pin
Stuart Dootson22-Jun-09 22:48
professionalStuart Dootson22-Jun-09 22:48 
GeneralRe: Performance problem with my FindOneOf function Pin
Ivan Ivanov 8323-Jun-09 0:32
Ivan Ivanov 8323-Jun-09 0:32 
GeneralRe: Performance problem with my FindOneOf function Pin
Stuart Dootson23-Jun-09 0:41
professionalStuart Dootson23-Jun-09 0:41 
GeneralRe: Performance problem with my FindOneOf function Pin
Ivan Ivanov 8323-Jun-09 4:17
Ivan Ivanov 8323-Jun-09 4:17 
GeneralRe: Performance problem with my FindOneOf function Pin
Ivan Ivanov 8324-Jun-09 1:11
Ivan Ivanov 8324-Jun-09 1:11 
AnswerRe: Performance problem with my FindOneOf function Pin
Skippums22-Jun-09 9:02
Skippums22-Jun-09 9:02 
GeneralRe: Performance problem with my FindOneOf function Pin
Stuart Dootson22-Jun-09 9:34
professionalStuart Dootson22-Jun-09 9:34 
GeneralRe: Performance problem with my FindOneOf function Pin
Ivan Ivanov 8322-Jun-09 11:28
Ivan Ivanov 8322-Jun-09 11:28 
"you are searching the same string for the same charset, so why not cache the result?"
- This is a good idea but I think it will make a major difference in my test code which tasts the came string and the same charset, and there aren't much cases like that in the real world. Smile | :) but I'll try it - I don't have much options anyway!

"Perhaps it realized that your set of input characters is consecutive, and instead of iterating through them it tests each character against a range."
- I've tested it with mixed characters and letters - it's the same story, so I don't think that's the case - but I appreciate the idea!

"Perhaps the standard implementation starts from the end of the string and searches forward."
- I thought about that, it's quite possible. Why I didn't test it with mirrored string already? Big Grin | :-D

"Perhaps the compiler realized that the standard call to FindOneOf in your loop could be optimized away since you are not using any values of that method call except the final one"
- Well I looked at the disassembly so I can tell that's not the case Wink | ;) - for each iteration of the test loop it calls CString::FindOneOf which then calls a bunch of other functions, somewhere in those functions I met call of "EnterCriticalSection" which blown my mind... ?! Big Grin | :-D
Otherwise you are quite right that standard functions are often optimized (as I mentioned about strlen) and the self-coded ones are not, especially those with __asm in them!

I think the lookup table has a potential!
AnswerRe: Performance problem with my FindOneOf function Pin
Roger Stoltz22-Jun-09 9:22
Roger Stoltz22-Jun-09 9:22 
GeneralRe: Performance problem with my FindOneOf function Pin
Ivan Ivanov 8322-Jun-09 10:59
Ivan Ivanov 8322-Jun-09 10:59 
GeneralRe: Performance problem with my FindOneOf function Pin
Roger Stoltz22-Jun-09 21:39
Roger Stoltz22-Jun-09 21:39 
GeneralRe: Performance problem with my FindOneOf function [modified] Pin
Ivan Ivanov 8324-Jun-09 1:45
Ivan Ivanov 8324-Jun-09 1:45 
GeneralRe: Performance problem with my FindOneOf function Pin
Roger Stoltz24-Jun-09 4:16
Roger Stoltz24-Jun-09 4:16 
GeneralRe: Performance problem with my FindOneOf function [modified] Pin
Ivan Ivanov 8325-Jun-09 1:25
Ivan Ivanov 8325-Jun-09 1:25 
QuestionXMLHTTP post failed with status code 415 Pin
Ash_VCPP22-Jun-09 3:47
Ash_VCPP22-Jun-09 3:47 
AnswerRe: XMLHTTP post failed with status code 415 Pin
KarstenK22-Jun-09 4:15
mveKarstenK22-Jun-09 4:15 
QuestionTimer on Statusbar Pin
susanne122-Jun-09 3:10
susanne122-Jun-09 3:10 
AnswerRe: Timer on Statusbar Pin
Rajesh R Subramanian22-Jun-09 3:25
professionalRajesh R Subramanian22-Jun-09 3:25 
AnswerRe: Timer on Statusbar Pin
David Crow22-Jun-09 4:05
David Crow22-Jun-09 4:05 
QuestionHow to access element in Multiset by index Pin
alikalik22-Jun-09 3:05
alikalik22-Jun-09 3:05 
AnswerRe: How to access element in Multiset by index Pin
Chris Losinger22-Jun-09 3:13
professionalChris Losinger22-Jun-09 3:13 
GeneralRe: How to access element in Multiset by index Pin
alikalik22-Jun-09 3:30
alikalik22-Jun-09 3:30 
AnswerRe: How to access element in Multiset by index Pin
Sarath C22-Jun-09 3:20
Sarath C22-Jun-09 3:20 
Questionsplit wavefiles programetically Pin
N Vamshi Krishna22-Jun-09 3:04
N Vamshi Krishna22-Jun-09 3:04 
AnswerRe: split wavefiles programetically Pin
Rozis23-Jun-09 6:42
Rozis23-Jun-09 6:42 

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.