Closed Bug 558962 Opened 15 years ago Closed 15 years ago

Memoize nsPlaintextEditor::GetDefaultEditorPrefs to avoid unnecessary calls to the pref service

Categories

(Core :: DOM: Editor, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

(Keywords: perf)

Attachments

(1 file)

Attached patch Patch (v1) (deleted) — Splinter Review
Currently, nsPlaintextEditor::GetDefaultEditorPrefs calls into the pref service each time it's called. As it turns out, this call is made at least once if you set the value on an input text control, which is really inefficient. We can listen for changes on that pref, and only update them when necessary.
Attachment #438639 - Flags: review?(roc)
Comment on attachment 438639 [details] [diff] [review] Patch (v1) +static +int one line + if (sNewlineHandlingPref == -1 && sCaretStylePref == -1) { Just check one of them
Attachment #438639 - Flags: review?(roc) → review+
OS: Mac OS X → All
Summary: Memoize nsPlaintextEditor::GetDefaultEditorPrefs to avoid unnecessary calls to the pref service → Memorize nsPlaintextEditor::GetDefaultEditorPrefs to avoid unnecessary calls to the pref service
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
The bug title wasn't a typo! :-) http://en.wikipedia.org/wiki/Memoization
Summary: Memorize nsPlaintextEditor::GetDefaultEditorPrefs to avoid unnecessary calls to the pref service → Memoize nsPlaintextEditor::GetDefaultEditorPrefs to avoid unnecessary calls to the pref service
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: