On Tuesday, 31 May 2016 at 01:55:16 UTC, Andrei Alexandrescu wrote:
I agree it's difficult to characterize the behavior of substring search with one number. There are many dimensions of variation. (But there's no reason for an emotional response.) A few possible baselines come to mind:

* Search a long string for a one-character string, match and fail.

There is a special version of find for searching a single char in a string. Using a one-letter needle string is more like a user mistake than something to optimize for.

* Take an English text string. Search for a substring consisting of its last portion (e.g. 5% of the length).

How long should the english text be? A Tweet? A book? A Gigabyte of log files?

English text means basically ASCII and no Unicode?

* Take an English text string. Search for a substring consisting of a fraction of the text (e.g. 3%) with additional characters prepended. Repeat for appended.

Why the prepend/append? To force a mismatch?


Reply via email to