Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.3.1
-
None
-
Windows 7 Desktop 64-bit
Description
Windows event loop actually keeps track off all processed timer to avoid live-lock as stated in code comment.
// avoid live-lock by keeping track of the timers we've already sent bool found = false; for (int i = 0; !found && i < processedTimers.count(); ++i) { const MSG processed = processedTimers.constData()[i]; found = (processed.wParam == msg.wParam && processed.hwnd == msg.hwnd && processed.lParam == msg.lParam); } if (found) continue; processedTimers.append(msg);
I was using application wkhtmltopdf, which internally uses webkit to convert input document to pdf. I found out, that there are many timers used in this toolchain and my application hanged most of the time in windows event loop, with numbers of processed timers almost equal to number of pdf pages rendered (3000+).
I wasn't sure, what is the reason to keep track of all timers, but I've changed processedTimers to be QSet instead of QVarLengthArray, which is really slow.
My patch is attached for review.