From: Геннадий З. <zab...@gm...> - 2015-08-26 17:33:33
|
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, Геннадий Забула <zab...@gm...> 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 <ji...@ci...> 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 >> Fir...@li... >> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider |