Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Report control slow markup performance
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report control slow markup performance

 Post Reply Post Reply
Author
Message
docontrol View Drop Down
Groupie
Groupie


Joined: 07 December 2009
Location: Denmark
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote docontrol Quote  Post ReplyReply Direct Link To This Post Topic: Report control slow markup performance
    Posted: 14 June 2018 at 6:09am
Hi guys,

I am faced with an issue for which I also have an open case with CodeJock. Still I want to hear if anyone else has experience in this matter and hopefully a solution.

We use the report control to generate lists of documents in a collection. Some properties of the documents are shown as markup on the same cell throughout the report control.

The problem that we are facing is that drawing the markup is very slow. We add a little over 3000 records. Most of these records contain markup in a specific column.

The way that we add the markup is more or less identical to your examples. We call EnableMarkup() on the report control and use SetCaption() on the markup item for each record/row.

The markup looks somewhat like this:

CString cstrMarkupShortSample(
_T("<DockPanel VerticalAlignment=\"Center\" HorizontalAlignment=\"Left\">")
_T("  <TextBlock Text=\"Introduction to the use of this manual\" Margin=\"0, 0, 5, 0\" />")
_T("  <Border Background=\"#FF0000\" CornerRadius=\"2\" Height=\"12\" Padding=\"4, 2, 4, 2\" Margin=\"0, 0, 5, 0\">")
_T("   <TextBlock Text=\"ISM\" Foreground=\"#FFFFFF\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" FontFamily=\"Verdana\" FontSize=\"8\" FontWeight=\"bold\" />")
_T("  </Border>")
_T("  <Border Background=\"#92D050\" CornerRadius=\"2\" Height=\"12\" Padding=\"4, 2, 4, 2\" Margin=\"0, 0, 5, 0\">")
_T("   <TextBlock Text=\"ISO14001\" Foreground=\"#FFFFFF\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" FontFamily=\"Verdana\" FontSize=\"8\" FontWeight=\"bold\" />")
_T("  </Border>")
_T("  <Border Background=\"#FFC000\" CornerRadius=\"2\" Height=\"12\" Padding=\"4, 2, 4, 2\" Margin=\"0, 0, 5, 0\">")
_T("   <TextBlock Text=\"ISO45001\" Foreground=\"#FFFFFF\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" FontFamily=\"Verdana\" FontSize=\"8\" FontWeight=\"bold\" />")
_T("  </Border>")
_T("  <Border Background=\"#00B0F0\" CornerRadius=\"2\" Height=\"12\" Padding=\"4, 2, 4, 2\" Margin=\"0, 0, 5, 0\">")
_T("   <TextBlock Text=\"ISO9001\" Foreground=\"#FFFFFF\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" FontFamily=\"Verdana\" FontSize=\"8\" FontWeight=\"bold\" />")
_T("  </Border>")
_T("  <Border Background=\"#FAC090\" CornerRadius=\"2\" Height=\"12\" Padding=\"4, 2, 4, 2\" Margin=\"0, 0, 5, 0\">")
_T("   <TextBlock Text=\"MLC\" Foreground=\"#000000\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" FontFamily=\"Verdana\" FontSize=\"8\" FontWeight=\"bold\" />")
_T("  </Border>")
_T("  <Border Background=\"#FFFF00\" CornerRadius=\"2\" Height=\"12\" Padding=\"4, 2, 4, 2\" Margin=\"0, 0, 5, 0\">")
_T("   <TextBlock Text=\"TMSA\" Foreground=\"#000000\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" FontFamily=\"Verdana\" FontSize=\"8\" FontWeight=\"bold\" />")
_T("  </Border>")
_T("</DockPanel>"));

The (all in-memory) loading process (before the call to Populate()) on a fast newer pc takes over 13 seconds. If we remove the call to SetCaption(), but still generate the markup, the call is completed in less than 1 second. Is the any way to speed this up (significantly).

Process memory grows from 17 MB to a staggering 240 MB (and 67 MB without markup). There can of course be many reasons for this, but generally all objects are created on the heap. This also means that the application takes a long time to clean up memory afterwards. Especially while using markup it is noticeably slower. Can the toolkit even handle working off the heap or is this required by design.

I tried to rule out errors by simple testing my markup in the Report Sample project and the same behavior is experienced. To stress test it I added loops to define 3000+ records and also apply 3000+ markup calls. When I use the default sample markup in cstrMarkupShortSample, it loads reasonably fast, but once I use our own markup it slows down noticeably.

I tried some even simpler markup on all 3000 records:

_T("<StackPanel VerticalAlignment='Top' HorizontalAlignment='Center'>")
_T("<TextBlock>Introduction to the use of this manual <Run Foreground='Red'>ISM</Run> <Run Foreground='Yellow'>ISO14001</Run> <Run Foreground='Green'>ISO45001</Run> <Run Foreground='Blue'>ISO9001</Run> <Run Foreground='Red'>MLC</Run> <Run Foreground='Red'>TMSA</Run>")
_T("</TextBlock>")
_T("</StackPanel>"));

This loads fairly fast, but the process memory is still quite high and it takes a long time to destruct all objects in the memory upon exiting the running application. 

This really makes me wonder if markup is even recommended in report control, when it is used broadly and for many records? 

Or is the purpose of the markup in the report control only to support very simple stuff, such as changing the color or boldness of a single word?  

A few details about my setup:

Product: Toolkit Pro for Visual C++ MFC
Product version: 18.4.0
Development platform: Visual Studio 2017 (toolkit v141)
Language(s): C++ 11, 14, 17, MFC
Operating system: Windows 10 Enterprise (64 bit) 1803
Relevant project settings: 32 bit, Unicode, MFC in shared DLL, _XTP_STATICLINK
Windows SDK: 8.1
Processor: Intel Core i7-6770HQ @ 2.60GHz
Memory: 16GB
Storage: 2 x 250 GB NVMe (not configured as raid)


Back to Top
bschaer View Drop Down
Groupie
Groupie


Joined: 27 June 2006
Location: United States
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote bschaer Quote  Post ReplyReply Direct Link To This Post Posted: 05 January 2019 at 11:27pm
Unfortunately, I've run into the same issue.  Have a property grid with ~60 lines.  The caption field in each line needs to be update once/second and the markup being thrown at it is NOT complex.  It's so slow you can literally watch the system draw the updates, almost as if it was a Tandy TRS-80.  So bad.

Not sure what I'm going to do with respect to a solution, perhaps the guys I send money to each year (for approximately 15 years) for contract renewal can determine if there is a path to making the product at all usable for either of us...

Best,
Brian

60 property grid lines of this and I feel like I'm back in 1979.

"<Grid VerticalAlignment = 'Center'><TextBlock>%s:  [%s] - [%s]</TextBlock><TextBlock TextAlignment='Center' Padding='50,0,0,0'>%s</TextBlock><TextBlock TextAlignment='Right' Padding='0,0,5,0'>%s</TextBlock></Grid>"

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.