Closed Bug 323821 Opened 19 years ago Closed 17 years ago

slowdown in about:config if filter term starts with *

Categories

(Toolkit :: Preferences, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9alpha8

People

(Reporter: zeniko, Assigned: zeniko)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060112 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060112 Firefox/1.5

Since the landing of the patch to bug 213832, filter strings starting with * unnecessarily slow down the whole browser. While it's easy to work around this problem (simply don't search for anything starting with *), the slowing down could still very cheaply be avoided - at least for all those who don't immediately get the new special meaning of *.

Reproducible: Always

Steps to Reproduce:
1. Open about:config
2. Filter for "*;false" (type slowly)

Actual Results:  
The browser hangs for several seconds.

Expected Results:  
No hanging.
Attached patch ignore leading '*'s (obsolete) — Splinter Review
Attachment #208782 - Flags: first-review?(mconnor)
Assignee: nobody → zeniko
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 208782 [details] [diff] [review]
ignore leading '*'s

Gavin: Is this anything we might want?
Attachment #208782 - Flags: first-review?(mconnor) → first-review?(gavin.sharp)
Attachment #208782 - Flags: first-review?(gavin.sharp) → review?(gavin.sharp)
Comment on attachment 208782 [details] [diff] [review]
ignore leading '*'s

Sorry for the delay. I'm very ambivalent about this patch... I don't think about:config performance for edge cases like these are really worth worrying about :)
Attachment #208782 - Flags: review?(gavin.sharp) → review+
Keywords: checkin-needed
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → Trunk
Comment on attachment 208782 [details] [diff] [review]
ignore leading '*'s

>+      rex = RegExp(substring.replace(/([^* \w])/g, "\\$1")
>+        .replace(/^[*]+/, "").replace(/[*]+/g, ".*"), "i");

This should be more straightforward and is theoretically (doesn't matter, really) faster:

>      rex = RegExp(substring.replace(/([^* \w])/g, "\\$1")
>                            .replace(/^\*+/, "")
>                            .replace(/\*+/g, ".*"), "i");
Attached patch for check-inSplinter Review
Attachment #208782 - Attachment is obsolete: true
Attachment #275233 - Flags: approval1.9?
Comment on attachment 275233 [details] [diff] [review]
for check-in

You don't need approval for front end patches like this one, at this stage.
Attachment #275233 - Flags: approval1.9?
mozilla/toolkit/components/viewconfig/content/config.js 	1.24
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: