Some preliminary profiling with DTrace suggests that the search bar contributes to ~2% of Firefox startup time in JSland. I measured the durations of all JS funcs from a warm startup until BrowserStartup() returns. 9ms (2.1%) is spent in textbox.xml. When I comment out the call to init() in the constructor of the search bar's binding or further delay the setTimeout() to 1000ms, textbox.xml drops to 3ms (0.8%). All the time appears to be spent in the document.getAnonymousElementByAttribute() call in the binding's "_textbox" field.
(In reply to comment #0) > All the time appears to be spent in the > document.getAnonymousElementByAttribute() call in the binding's "_textbox" > field. Need to be careful with JS-only profiling - that call is slow because it forces forces synchronous XBL attachment of the textbox element, I'm guessing (but would be good to confirm!). Delaying the call to init presumably delays the running of that code until the binding has already been attached, so unless the process is inefficient because of ordering, I'm not sure that just delaying it will help much in practice (it will reduce the time spent waiting on XBL-called-from-JS, but the XBL attachment delay will still occur on its own eventually).
is this WONTFIX? comment #1 makes it sound like there's no way around this in the search binding itself, and that we need to instead investigate deeper into why attaching the textbox binding is so slow.
This doesn't seem actionable.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.