Closed
Bug 963105
Opened 12 years ago
Closed 12 years ago
Improve performance of #label-control formatAccessKey
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: enndeakin, Assigned: enndeakin)
References
Details
Attachments
(1 file)
6.00 KB,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
For instance, it should at least return earlier if no accesskey or text is present.
Assignee | ||
Comment 1•12 years ago
|
||
Comment 2•12 years ago
|
||
Comment on attachment 8364450 [details] [diff] [review]
improveaccesskey
>+ var accessKey = this.accessKey;
>+ // No need to remove existing formatting the first time.
>+ if (firstTime && !accessKey)
>+ return;
>+
>+ if (this.mInsertSeparator === undefined) {
[if and try were nested the wrong way around]
>+ }
>+
> if (!this.mUnderlineAccesskey)
> return;
Can we use lazy field evaluation to achieve this, i.e. move the initialisation from the <constructor> to the definition of mUnderlineAccesskey rather than the formatAccessKey method?
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #2)
> Can we use lazy field evaluation to achieve this, i.e. move the
> initialisation from the <constructor> to the definition of
> mUnderlineAccesskey rather than the formatAccessKey method?
Fields get compiled for every usage so I'm not sure that would be faster.
Comment 4•12 years ago
|
||
(In reply to Neil Deakin from comment #3)
> (In reply to comment #2)
> > Can we use lazy field evaluation to achieve this, i.e. move the
> > initialisation from the <constructor> to the definition of
> > mUnderlineAccesskey rather than the formatAccessKey method?
>
> Fields get compiled for every usage so I'm not sure that would be faster.
Fair enough, you need to optimise for performance here. [Now if we could only share variables between bindings so that we only needed to evaluate them once per document or some such...]
Comment 5•12 years ago
|
||
Comment on attachment 8364450 [details] [diff] [review]
improveaccesskey
>+ try {
>+ if (this.mInsertSeparator === undefined) {
It makes more sense to me to condition the entire try block i.e.
if (this.mInsertSeparator === undefined) {
try {
// rest of code moved from constructor
}
catch (e) {
this.mInsertSeparator = true;
}
}
r=me with that fixed.
Attachment #8364450 -
Flags: review?(neil) → review+
Assignee | ||
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Comment 8•12 years ago
|
||
The regression that this fixes[1] exists on mozilla-aurora. Are we able to uplift this as well?
[1]: bug 967691
Flags: needinfo?(enndeakin)
Comment 9•12 years ago
|
||
(In reply to Mike Conley (:mconley) from comment #8)
> The regression that this fixes[1] exists on mozilla-aurora. Are we able to
> uplift this as well?
>
> [1]: bug 967691
The target milestone here is 29. This fix should be in 29 already.
Assignee | ||
Updated•12 years ago
|
Flags: needinfo?(enndeakin)
You need to log in
before you can comment on or make changes to this bug.
Description
•