AutoCompleteSuggestHelper, Assembly: Telerik.WinControls.UI, Version=2019.1.117.40
Isnt the hilighted line (contains branch) very unoptimized.
https://rhale78.wordpress.com/2011/05/16/string-equality-and-performance-in-c/
Multiple ToLower string operation. Why not let the framework do the operation since you are always using ordinal?
optimized version: return item.Text.Contains(this.Filter, StringComparison.OrdinalIgnoreCase);
protected virtual bool DefaultFilter(RadListDataItem item)
{
switch (this.suggestMode)
{
case SuggestMode.StartWiths:
return item.Text.StartsWith(this.Filter, this.StringComparison);
case SuggestMode.Contains:
if ((this.StringComparison & StringComparison.InvariantCultureIgnoreCase) == StringComparison.InvariantCultureIgnoreCase || (this.StringComparison & StringComparison.InvariantCultureIgnoreCase) == StringComparison.CurrentCultureIgnoreCase)
return item.Text.ToLower().Contains(this.Filter.ToLower()); return item.Text.Contains(this.Filter);
default:
return item.Text.StartsWith(this.Filter, this.StringComparison);
}
}