News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Compar Strings

Started by mabdelouahab, April 29, 2015, 03:00:23 AM

Previous topic - Next topic

mabdelouahab

Quote from: hutch-- on April 29, 2015, 10:20:04 AM
If you want speed in order of performance, a finite state machine (static tree) is the fastest, a well designed hash table performs OK and somewhere down the track normal string compares come a distant last.

What I would recommend is a first character lookup to a label address that splits the word range alphabetically so that if your first character is "g", you only have to scan a list of words starting with "g" rather than the whole list. If done correctly it will hit into about the middle range of performance without having to write complex algorithms.
hutch
I think that I've been working on this , And I would  added:
initially Must hold 850 check, When checking string length (Max length = 10, mean lower check 850/10)= Keep about 85 check, Then check the first character (character number 25 A-Z, reducing verification 85/25)=Keep about 3 to 4 check (Gain some 97%)
But should we arrange table first