This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Here are the results for the tests on my system:(4) is definitely the way to go, everything considered.
1. n^2 algo. re-implemented. 4. find in terms of std::search -> as suggested by Matt Austern.
The numbers for (1) and (4) are the best in most cases. However, (1)
does not come out a winner in all cases, whereas (4) seems to be the
best for the general case.
string::size_typeBy the way, this implementation is incorrect, strictly speaking (not that this
s_search(const string& data, const string& src)
{
string::const_iterator i = std::search(src.begin(), src.end(), data.begin(), data.end());
return (i - src.begin());
}
Thanks for your numbers! I'm finishing up implementing (4) and will include in the patch your performance testcases.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |