Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [solved] Virtual mode bad performance
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] Virtual mode bad performance

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (1) Thanks(1)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: [solved] Virtual mode bad performance
    Posted: 30 June 2016 at 12:28am
Hi all

we use a report control in virtual mode to show log entries.  We have log files with many tens of millions of records in them.

There's a function in the report control that clears merge height on all rows.  It's not optimised for virtual mode.

void CXTPReportRows::ClearMergeHeight()
{
int nCount = GetCount();
for (int i = 0; i < nCount; i++)
{
CXTPReportRow* pRow = GetAt(i);
if (pRow)
pRow->SetMergeHeight(-1);
}
}

GetAt(i) always returns the m_pVirtualRow

so this call sets the same member on the same object to the same value tens of millions of times for us.

You might want to check if it's virtual mode before calling all this.

Adrien
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (1) Thanks(1)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 30 June 2016 at 12:34am
function should look like this.  Performance is at least 100 times quicker to redraw.

void CXTPReportRows::ClearMergeHeight()
{
int nCount = GetCount();

if (NULL != m_pVirtualRow)
{
m_pVirtualRow->m_nIndex = nCount;
m_pVirtualRow->SetMergeHeight(-1);
return;
}

for (int i = 0; i < nCount; i++)
{
CXTPReportRow* pRow = GetAt(i);
if (pRow)
pRow->SetMergeHeight(-1);
}
}
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 30 June 2016 at 5:30pm
Hello Adrien,

Thank you for this important remark and proposal.

At first we need to check CXTPReportPaintManager::m_bAllowMergeCells to prevent excessive calling SetMergeHeight in non virtual mode also.

Also merged cells don't have sens in VirtualMode  in current implementation of ReportControl. That is why you can use only
    if (NULL != m_pVirtualRow)
  {
    return;
  }

So I propose other implementation of 
ClearMergeHeight but CXTPReportPaintManager::m_bAllowMergeCells are not visible in XTPReportRows.cpp. I want to add method CXTPReportControl::IsMergedCellsAllowed to get access to m_bAllowMergeCells from other parts of code.

So, correction of this issue  affects other parts of code and I can't fix and show you only 
CXTPReportRows::ClearMergeHeight() method.  Fix will be available in the next beta or final release.

Regards,
 Oleksandr Lebed
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2016 at 7:48am
I have changed default value of CXTPReportPaintManager::m_bAllowMergeCells to FALSE. This will prevent excessive calls in CXTPReportRows::ClearMergeHeight in non virtual mode too.

So from next release  
CXTPReportPaintManager::m_bAllowMergeCells  should be set to TRUE  before using merge cells.
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.