Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
FindFirstIn
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="BartC" data-source="post: 5161114"><p>If the same set if being used to match against millions of short strings,</p><p>then possibly creating the set can be a bottleneck. In this case, perhaps</p><p>allow for the caller to supply the set (maybe using an extra function to</p><p>create it separately). Then that overhead can be largely eliminated.</p><p></p><p>Also, when searching the same (long) string many times, for a different set</p><p>each time, it might be worth creating an index (table of char*) of the 256</p><p>characters with the initial position in the string (with NULL if a character</p><p>does not occur).</p><p></p><p>Then search time for subsequent finds depends only on the length of the set</p><p>(maximum 256). For a single character set, that would take no time at all.</p></blockquote><p></p>
[QUOTE="BartC, post: 5161114"] If the same set if being used to match against millions of short strings, then possibly creating the set can be a bottleneck. In this case, perhaps allow for the caller to supply the set (maybe using an extra function to create it separately). Then that overhead can be largely eliminated. Also, when searching the same (long) string many times, for a different set each time, it might be worth creating an index (table of char*) of the 256 characters with the initial position in the string (with NULL if a character does not occur). Then search time for subsequent finds depends only on the length of the set (maximum 256). For a single character set, that would take no time at all. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
FindFirstIn
Top