Print Page | Close Window

[solved] Virtual mode bad performance

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=23068
Printed Date: 27 April 2024 at 2:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] Virtual mode bad performance
Posted By: adrien
Subject: [solved] Virtual mode bad performance
Date 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


-------------
http://www.wingate.com - http://www.wingate.com



Replies:
Posted By: adrien
Date 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);
}
}


-------------
http://www.wingate.com - http://www.wingate.com


Posted By: olebed
Date 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


Posted By: olebed
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net