Opened 6 months ago

Closed 4 months 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:
Has a Patch: no 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)

0001-text_search-avoid-flooding-messages-while-searching.patch (2.3 KB) - added by phoudoin 6 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 months ago by phoudoin

Status: newin-progress

comment:2 Changed 6 months ago by phoudoin

Status: in-progressassigned

comment:3 Changed 6 months ago by phoudoin

Implementing something along 5) to avoid flooding the message queue with non usefull data at such high rate: will report only at 20Hz max.

comment:4 Changed 6 months ago by phoudoin

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 Changed 4 months ago by KapiX

Resolution: fixed
Status: assignedclosed

Applied in hrev52195. Works great, thanks!

Note: See TracTickets for help on using tickets.