One more question about string.Equals. Comparison type used in IndexOf calls is StringComparison.CurrentCultureIgnoreCase. My question why this used instead of OrdinalIgnoreCase? My current optimization, including StringComparison change decreased timings to 22 (names) vs 6 (indexes) seconds.
On 26 August 2015 at 20:33, Геннадий Забула <zabulu...@gmail.com> wrote: > About Equals call I'm not sure it can be optimized somehow. > But decreasing cost of NormalizeParameterName should significantly > reduce overall case execution time. > > On 26 August 2015 at 20:27, Геннадий Забула <zabulu...@gmail.com> wrote: >> I've profiled case and found out next hot paths: >> >> get_Item: 54,56% >> 1. 30.30% >> return this.parameters.FindIndex((Predicate<FbParameter>) (x => >> x.InternalParameterName.Equals(normalizedParameterName, >> StringComparison.CurrentCultureIgnoreCase))); >> Equals call >> 2. 21,51% >> internal static string NormalizeParameterName(string parameterName) >> { >> if (string.IsNullOrEmpty(parameterName) || >> parameterName.StartsWith("@")) >> return parameterName; >> return string.Format("@{0}", (object) parameterName); >> } >> This method also can be optmized. >> StartsWith -> parameterName[0] == '@' >> string.Format -> string.Concat("@", parameterName) >> >> On 26 August 2015 at 16:45, Jiří Činčura <j...@cincura.net> wrote: >>>> Can you share profiler report? >>> >>> There's a test app attached to the ticket. It clearly shows the hot spot. I >>> can share only times (from my machine). >>> >>> -- >>> Mgr. Jiří Činčura >>> Independent IT Specialist >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Firebird-net-provider mailing list >>> Firebird-net-provider@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider ------------------------------------------------------------------------------ _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider