[solved] Virtual mode bad performance |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(1)
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
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(1)
|
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); } } |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
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
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 |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
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. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |