Opened 7 years ago
Closed 6 years ago
#14175 closed bug (fixed)
TextSearch becomes unresponsive during search
Reported by: | KapiX | Owned by: | phoudoin |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Applications/TextSearch | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
As in title. Cancelling a big search is almost impossible. Neither keyboard nor mouse works.
My guess is that message queue gets filled up with MSG_REPORT_FILE_NAME [1] and can't handle keyboard/mouse events until it's empty.
I would like this ticket to be a brainstorming place how to remedy that.
My ideas:
1) Update text view less frequently, for example not for each file, but for each directory.
2) Create a separate thread to respond to specific key. I don't like that though, since it replicates GUI's responsibilities.
3) Batch updates.
4) Implement some kind of throttling mechanism, that would stop sending/discard MSG_REPORT_FILE_NAME messages after a certain limit is reached.
5) Use BMessageRunner to send MSG_REPORT_FILE_NAME at regular intervals that the app_server would be able to handle in reasonable time.
I think 5) is the best one and it should be easy to implement.
[1] https://git.haiku-os.org/haiku/tree/src/apps/text_search/GrepWindow.cpp#n962
Attachments (1)
Change History (6)
comment:1 by , 7 years ago
Status: | new → in-progress |
---|
comment:2 by , 7 years ago
Status: | in-progress → assigned |
---|
comment:3 by , 7 years ago
by , 7 years ago
Attachment: | 0001-text_search-avoid-flooding-messages-while-searching.patch added |
---|
comment:4 by , 7 years ago
Here the patch, that I may be able to push myself asap I figure out why any access to git ends on timeout...
comment:5 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Applied in hrev52195. Works great, thanks!
Implementing something along 5) to avoid flooding the message queue with non usefull data at such high rate: will report only at 20Hz max.