User forums > Help
CPU 100% when moving mouse in CB (toolbar/editor/manager/etc)
bughunter2:
As the topic title says, when moving the mouse, the CPU usage reaches 100%.
I've searched for topics like these, and have read in some topic that thomas recommended to remove the lines with "EVT_UPDATE_UI" to test if the CPU usage is still that high. I've updated to the last SVN, removed these lines and rebuilt CB.
The CPU usage is now about 44% max if I move the mouse inside CB.
FYI: I have a 2000dpi mouse, 2GB of RAM and an AMD64 2.2GHz
(edit: however in CB I set the mouse's dpi to 800, there are buttons on the mouse to change the dpi)
thomas:
Hmm not sure if that's good or bad :?
Good insofar as if it really reduces the load by one half for you, then we have a hint that my theory may at least partially be right (though other people have reported no visible difference).
Bad insofar as those messages are needed to keep the menu states in sync, and it'll be a horror to remove them...
Pecan:
--- Quote from: thomas on March 06, 2007, 09:45:44 am ---Hmm not sure if that's good or bad :?
Good insofar as if it really reduces the load by one half for you, then we have a hint that my theory may at least partially be right (though other people have reported no visible difference).
Bad insofar as those messages are needed to keep the menu states in sync, and it'll be a horror to remove them...
--- End quote ---
ummmmm. Maybe not. Notice that in main.cpp the same code is being executed over and over again for a single UI cycle. For example:
--- Code: --- EVT_UPDATE_UI(idEditUndo, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditRedo, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditCopy, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditCut, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditPaste, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditSwapHeaderSource, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditGotoMatchingBrace, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditFoldAll, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditUnfoldAll, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditToggleAllFolds, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditFoldBlock, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditUnfoldBlock, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditToggleFoldBlock, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditEOLCRLF, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditEOLCR, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditEOLLF, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditEncoding, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditSelectAll, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditBookmarksToggle, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditBookmarksNext, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditBookmarksPrevious, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditCommentSelected, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditAutoComplete, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditUncommentSelected, MainFrame::OnEditMenuUpdateUI)
EVT_UPDATE_UI(idEditToggleCommentSelected, MainFrame::OnEditMenuUpdateUI)
--- End code ---
This is just one example of many.
Is there anyway on secondary calls to set a flag that says, "Hey, I've already done this for now"; then on the last call clear the flag?
Is there any correlation between OnIdle and UI updates? If so, a flag might be set there?
Can a timer be set to only honor UI calls every xxx mils?
bughunter2:
Actually I just opening some files and closed them, tried some menu's. Nothing weird happened on the rebuilt CB (without the update UI events)
Seems it's not that much of a horror? Maybe it's because the UI is indeed already updated as Pecan said.
bughunter2:
Any new info on this?
Navigation
[0] Message Index
[#] Next page
Go to full version