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

C / C++ / MFC

 
GeneralRe: Generic Specialized Template Definitions Pin
Skippums23-Jun-09 3:22
Skippums23-Jun-09 3:22 
GeneralRe: Generic Specialized Template Definitions Pin
Stuart Dootson23-Jun-09 3:36
professionalStuart Dootson23-Jun-09 3:36 
AnswerRe: Generic Specialized Template Definitions Pin
Nemanja Trifunovic22-Jun-09 9:34
Nemanja Trifunovic22-Jun-09 9:34 
GeneralRe: Generic Specialized Template Definitions Pin
Skippums22-Jun-09 9:52
Skippums22-Jun-09 9:52 
GeneralRe: Generic Specialized Template Definitions Pin
Nemanja Trifunovic22-Jun-09 10:04
Nemanja Trifunovic22-Jun-09 10:04 
QuestionPerformance problem with my FindOneOf function [modified] Pin
Ivan Ivanov 8322-Jun-09 4:09
Ivan Ivanov 8322-Jun-09 4:09 
AnswerRe: Performance problem with my FindOneOf function Pin
Stuart Dootson22-Jun-09 8:46
professionalStuart Dootson22-Jun-09 8:46 
GeneralRe: Performance problem with my FindOneOf function Pin
Ivan Ivanov 8322-Jun-09 22:30
Ivan Ivanov 8322-Jun-09 22:30 
Check this out Smile | :)

It seems the the test code wasn't appropriate
CString str2[] = { "1234567890", "qwtyupzxghiocervbasdjklfnm", "qwo123ertyui45", "qwzxy1uldfghjk2bnm3ertcviopas" };

int index = 0;
CFString str1("abcdefghijklmnoprstuzxwvqyqwertyuio0987654321");

int i = 0;
int start = GetTickCount();
for(int pos = 0; pos < 100000000; pos++)
{
    index = 0;
    index = str1.FindOneOf(str2[pos % 4]);
}
int time = GetTickCount() - start;

CString strTime;
strTime.Format("%d, %d", time, index);
m_editResult.SetWindowText(strTime);

In this eaxmple which includes a number of different charsets my function finishes for 19000ms and CString::FinOneOf for 25450ms which is 6468ms slower, in other words my function is 25% faster. Do you think that this test code is more accurate?

And about the MS Lookup table I look at it too and I wonder if that's quite legal, I mean that according to my assembly book the instruction BTS sets a bit in the target pointed by its position BUT MAX POSITION IS 31!!! in this case they set bits in a larger memory block by setting positions up to 255 - I wonder how this works, it does obviously?! Maybe my assembly book is obsolete.
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 
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 

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.