Hi,
We've had numerous customers report a slowdown in our WinForm client since the February 2021 Windows 10 Cumulative update. We have been working with Microsoft developer support to find what caused this. It appears this update introduced a slowdown in the WIndows API GdipMeasureString. One place this gets called is from Graphics.MeasureString. Microsoft is working on a fix for this but so far the solution they have come up with does not seem to return performance to it's original levels.
One spot we have found where MeasureString gets called is from the UltraGrid. For instance setting the Active row will trigger a call into the Infragistics.Win.DrawUtility.MeasureString method which in turn calls Graphics MeasureString.
We are currently using the 2012 V2 version of the Infragistics controls and we are wondering if you are aware of this MS API slowness and if there have been any changes done to the controls since 2012 that might have improved this?
We are trying to determine if we should upgrade to the latest version or not.
Thanks
Hello Todd,
Thank you for posting on our forums.
Should the performance issue come from regression caused by MS, I am certain that this will be resolved on their end, or at least they should provide an alternative in order to compensate for this.
There have been a lot of changes in our components over the years, however I cannot confirm if these changes will affect your scenario in a positive way.
The best advise I can give is to download our latest version as trial to run tests and see if performance will improve. Either way, version 12 is long past its support lifetime, so in case MS provide resolution for this issue, the changes can be only implemented for our latest versions.
Should you have any further questions or concerns, please let me know
Sincerely,Tihomir TonevAssociate Software DeveloperInfragistics
We are seeing similar reports from some end users and we also assume an MS update was a factor. We are running 19.1 version and traced the slowdown to UltraGridColumn.PerformAutoResize. We are only resizing first 10 rows, but still takes several second per column. Going to try other approaches to calculating column size, but any other info would be helpful.
According to the Windows engineer that analyzed the regression, the problem is that Infragistics is calling GdipMeasureString an unusually high number of times. Also that it calls it with a different instance of a font each time even though it is the same font (not entirely sure what that means but hopefully your engineers will).
Hm. That explanation is a bit confusing for a number of reasons. First, I'm not sure exactly what is meant by "GdipMeasureString". Is that just Graphics.MeasureString? Or are they specifically referring to using GDI Plus? Or is that "p" a typo and they meant to say GDI? Second, we haven't changed anything fundamental about how we measure strings or how often we measure them. So if the Windows Update caused the issue, then this is something Microsoft changed on their end. Are they saying they introduced a performance issue in Windows when measuring strings? If so, then hopefully, they will fix that in Windows. We can't go in and fundamentally restructure our entire suite of controls due to a temporary bug in Windows 10.
If this is, in fact, an issue with GDI Plus, then you could work around it by switching to GDI text rendering. You can do that for your entire application like so: Infragistics.Win.DrawUtility.UseGDIPlusTextRendering = false;
I would put that into your Main method or in the constructor of your main form.
The GdipMeasureString is the underlying C method that gets called by Graphics.MeasureString. It's the use of Graphics.measureString that triggers this. Yes this was introduced by a change in Windows 10. MS is working on a fix for this, but from what we are seeing with our customers that have been testing the fix it does not return performance completely back to previous levels.
We tried different things like upgrading the the latest Infragistics version, UseGDIPlusTextRendering = false but neither helped. We noticed the sample applications did not have the issue so looking at differences in our app and the sample app we stumbled on the fact that removing the code load our style .isl file seemed to avoid the issue. Then further review about what was in the file, we found changing this one line
<state name="Normal" fontName="Segoe UI" themedElementAlpha="Transparent" />
to
<state name="Normal" fontName="" themedElementAlpha="Transparent" />
Seemed to avoid the issue and still maintain the significant part of the style.
We will continue to test this, but wanted to pass along what we found so far.
Segoe UI has always been problematic for text measurement. It returns all sorts of inconsistent results. So I wonder if what's happening here is that the AutoResize on the column is getting into some kind of loop where we are measuring the same text and getting different results.I would have thought using GDI would get around that, though. I wonder if the UseGDIPlusTextRendering setting is being ignored because your application is setting the property elsewhere, or on the control or something like that. Are you seeing a visual difference in the way text is drawn when you switch that off? You can't actually switch it at run-time, so you might want to just take a screen shot with and without that setting and see if you can spot a difference.