Closed Bug 928108 Opened 11 years ago Closed 5 years ago

Batch keystrokes when doing full-text search in current file in debugger (Ctrl-F)

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: harth, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Doing a full text search of a script in the debugger (Cmd-F), there's a big pause on each keystroke.

It should batch keystrokes so that it doesn't perform a search on each stroke, but rather after you've entered a few characters in succession. If it does this already, we might want to increase the timer.

If this could be performed on a worker, that would be awesome too. You can cancel a previous worker if more is typed.
They're already batched: https://mxr.mozilla.org/mozilla-central/source/browser/devtools/debugger/debugger-panes.js#1892

Sounds like we need to either increase the max delay or tweak the algorithm a bit. The delay gets smaller the more you type.
I'll try it out with increasing the max delay. It works pretty smoothly on my Retina, but hiccups quite a bit on my old Air.
This is still a problem. It's quite bad on my Air.

I tried increasing several delays by a lot, with no dice. There's a hiccup on every character. Looking at the code, do we batch single-file token searches? https://mxr.mozilla.org/mozilla-central/source/browser/devtools/debugger/debugger-toolbar.js#1002
Summary: Batch keystrokes when doing full-text search in debugger → Batch keystrokes when doing full-text search in current file in debugger (Ctrl-F)
Priority: -- → P3
Victor, am I on to anything in comment 3?

This problem has made me use dump statements instead of using the browser debugger because it's so hiccupy on my Air. The debugger is effectively unusable for me as I need Cmd-F most every time I use the debugger to find the place I want to set a breakpoint.

I bet others with slower computers run into this as well.
Flags: needinfo?(vporof)
I misread you in a previous comment, I thought this was about full text search across all files in the debugger (which does indeed batch keystrokes).
Sorry!

Text in a single file (using the # operator) does not batch keystrokes. Sounds like a good idea to add that, but I'm afraid it might not be super straightforward, because most tests rely on a sync behavior. But while this won't be a good first bug, it's definitely doable.

Maybe we should also investigate why CodeMirror is so slow while searching inside a single file. It sounds to me like this shouldn't be a very costly operation. Have you tried profiling it?
Flags: needinfo?(vporof)
Attached image screenshot of profile
Here's a screencap of a profile of searching through a large file in the debugger. Notice that I am getting some jank on a one year old MBP retina :(
Heather, are you willing to work on this?
I no longer see pauses on each keystroke. For me, this bug is resolved-worksforme. I'm running on a Lenovo W520 with Windows 7 though, so maybe retina Macbooks are still suffering.
Let's see if anyone with a Mac, or something slower than a W520 can still reproduce this. If not, this can probably be marked as WORKSFORME.
Product: Firefox → DevTools
This is not an issue in the new debugger.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Blocks: 1565711
Blocks: 1565713
No longer blocks: 1565711
No longer blocks: 1565713
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: