Closed
Bug 49468
Opened 24 years ago
Closed 2 years ago
nsTextInputListener::Focus() is slow
Categories
(Core :: DOM: Editor, defect, P5)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: sfraser_bugs, Unassigned)
References
Details
(Keywords: perf)
nsTextInputListener::Focus() is called whenever a text widget is focussed (e.g. when you bring the browser window to the front with focus in the url bar). It accounts for about 60% of the time taken to handle the focus event, which seems high. The slow part is the call to nsGfxTextControlFrame::GetText(), which goes through the output system. This same code path happens when you type in a textfield (only with maxlength) because we measure the length of the text each time. We should optimize this.
Reporter | ||
Comment 1•24 years ago
|
||
(only with maxlength) should be been a query (only with maxlength?) since I'm not sure if we only do this if the field has a maxlength specified on it. We should.
Status: NEW → ASSIGNED
Comment 2•24 years ago
|
||
Didn't we at one time (pre ender lite, so maybe it's not there in ender lite text controls) have an optimization where the text control remembered its current text, so it didn't have to go through the output system unless something happened that might change the text? Or is that impossible because we're worried that someone might change the content out from under the text control? There's a lot of room for optimization in the output system (and there are bugs filed on that, but they're nsbeta3-, of course) but as long as it has to go through XIF, it will be somewhat slow even if the rest of the process is optimized (going through XIF involves two parsing stages and a lot of memory allocation/copying). It would be much better if we could cache.
Reporter | ||
Comment 3•24 years ago
|
||
nsTextInputListener::Focus() is getting the value of the text field and storing it, so that it can compare with the value on Blur(), and thus know to fire an onChange event. Almost all the time in GetText() is spend in nsDOMSelection::ToString()
Reporter | ||
Comment 4•24 years ago
|
||
A lot of time is being spent in nsRange code here too. nsRange is the class that takes the most time (exclusive of children) in this whole operation; it does a lot of mallocs via creating new ranges, and manipulating nsVoidArrays.
Comment 5•24 years ago
|
||
there has been an addition to the dom spec for range (at my request, my god i've affected a w3c spec - when will the madness end!) that will allow us to recycle ranges. So we may be able to aviod the mallocs by maintaining a pool of ranges. The voidarray stuff is more problematic: it's part if the implementation. I already cahce voidarrays statically in range so that i dont have to alloc them all the time. I don't know of any more quick wins there but that doesn't mean there aren't any. You should introduce me to your call chain data and I can think about ways to speed things up.
Comment 6•24 years ago
|
||
Simon: Is this still a problem? Are you covering it in other performance bugs?
Target Milestone: --- → M20
Reporter | ||
Comment 7•24 years ago
|
||
This needs to stay open for Range perf improvements.
Reporter | ||
Comment 10•23 years ago
|
||
Won't get to this for 0.9
Target Milestone: mozilla0.9 → mozilla0.9.1
Comment 13•23 years ago
|
||
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 (you can query for this string to delete spam or retrieve the list of bugs I've moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Reporter | ||
Comment 14•22 years ago
|
||
Pre-sabbatical bug triage.
Target Milestone: mozilla1.0.1 → Future
Reporter | ||
Comment 15•22 years ago
|
||
Pre-sabbatical bug triage.
Target Milestone: Future → mozilla1.2alpha
Reporter | ||
Updated•21 years ago
|
Target Milestone: mozilla1.2alpha → mozilla1.5alpha
Comment 16•21 years ago
|
||
This bug is targeted at a Mac classic platform/OS, which is no longer supported by mozilla.org. Please re-target it to another platform/OS if this bug applies there as well or resolve this bug. I will resolve this bug as WONTFIX in four weeks if no action has been taken. To filter this and similar messages out, please filter for "mac_cla_reorg".
Reporter | ||
Updated•21 years ago
|
OS: Mac System 8.5 → MacOS X
Target Milestone: mozilla1.5alpha → Future
Updated•17 years ago
|
QA Contact: sujay → editor
Reporter | ||
Updated•16 years ago
|
Assignee: sfraser_bugs → nobody
Comment 17•16 years ago
|
||
This bug hasen't been touched for years and is clearly unowned. Moving back to default assignee/QA so that people, who are watching those can accurately triage this bug. Also resetting Priority, Target Milestone, Status Whiteboard and Status.
Status: ASSIGNED → NEW
Priority: P3 → --
Whiteboard: [nsbeta1+]
Target Milestone: Future → ---
Comment 18•3 years ago
|
||
Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.
If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
Comment 19•2 years ago
|
||
There is no such method and we've already optimized a lot around getting text editor value for Quantum Flow. Let's close this ancient bug, and feel free to file new bug if you still see some slow methods at moving focus.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•