forked from rhoot/Gw2Browser
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I think I've found an issue with the event handling for the indexing tasks.
gw2browser/src/BrowserWindow.cpp
Lines 425 to 431 in c5098c2
| void BrowserWindow::onPerformTaskEvt( wxIdleEvent& p_event ) { | |
| Ensure::notNull( m_currentTask ); | |
| m_currentTask->perform( ); | |
| if ( !m_currentTask->isDone( ) ) { | |
| m_progress->update( m_currentTask->currentProgress( ), m_currentTask->text( ) ); | |
| p_event.RequestMore( ); |
After each entry p_event.RequestMore( ); is called, which will eventually execute onPerformTaskEvt(..) again. This seems to take a lot of time.
As a hack I've added a for-loop to process more items on each call of the method.
void BrowserWindow::onPerformTaskEvt( wxIdleEvent& p_event ) {
Ensure::notNull( m_currentTask );
for (size_t i = 0; i < 1000; i++)
{
m_currentTask->perform();
if (m_currentTask->isDone()) {
break;
}
}
if ( !m_currentTask->isDone( ) ) {
m_progress->update( m_currentTask->currentProgress( ), m_currentTask->text( ) );
p_event.RequestMore( );
}This leads to a significant performance boost for the indexing/saving/loading tasks. Normally indexing takes multiple hours, with my hack it takes a few minutes.
This is only a hack, as I'm unexpirenced in cpp/wxwidgets
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels