We are initializing the appearance for an editor control that we are using like this:
internal class HiddenLinkFormattedTextEditor : UltraFormattedTextEditor { internal HiddenLinkFormattedTextEditor() { var foreColor = Color.FromArgb(0xFF, 0x38, 0x43, 0x50); // DarkNavy this.ActiveLinkAppearance.ForeColor = foreColor; this.ActiveLinkAppearance.Cursor = Cursors.Arrow; this.LinkAppearance.ForeColor = foreColor; this.LinkAppearance.Cursor = Cursors.Arrow; this.HotTrackLinkAppearance.ForeColor = foreColor; this.HotTrackLinkAppearance.Cursor = Cursors.Arrow; this.VisitedLinkAppearance.ForeColor = foreColor; this.VisitedLinkAppearance.Cursor = Cursors.Arrow; this.VisitedLinksManager = null; this.UnderlineLinks = UnderlineLink.Never; }
In the performance profiler I see that the appearance calls are translated to 4 calls to Infragistics.Win.Appearance.set_ForeColor (obviously a static property) which takes about 1 second during startup of our application (probably because there are already a couple of instantiated and bound grids where this property then gets re-applied).
Is there a better way to do this? Since these are static properties - do I need to introduce my own marker variable that I set when I have gone through this initialization once (even if it looks like it is setting instance properties)?
Any other suggestions for optimizing performance for this initialization?
Please note: this particular method seems to have gotten slower compared to the pretty ancient version (IG 2011) that we have been using until recently.
Hello Uwe,
Thank you for contacting. Looking into the winform document here is a general Grid performance guide if you wants to have a look ,
https://ko.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/15306/wingrid-performance-guide
In terms of appearance performance we don’t have any document to give us this particular information.
May be try using app appstylist for the style and see if it give you better performance.
Also may i know how you are checking the performance? Can you share the sample to compare the behavior with Version 2011,
Its possible that since 2011 we have made lots of changes cause this behavior that i would need to test with your sample.
Regards,
Hello Deviya,
I have attached the sample project (very basic WinForms project which creates a form with embedded grid and binds some data). I have also taken profiles for the startup of this application with two versions of Infragistics:
This is the startup performance when using Infragistics 2011 (for this project):
And this is the counterpart for 2021:
There is about 400ms difference which does not sound like a lot but when you are trying to optimize launch times for an application each contribution becomes relevant.
In contrast to what I said above I don't think this is related to setting the ForeColor for the editor - it's just anything that triggers the initial call to Infragistics.WinAppStyling.StyleSetInfo.LoadContent.
Please let me know if there's something I can do to avoid the overhead (I see that most of the time is spent in ParseGlyphInfo).
GridPerfTest.zip