Closed
Bug 91168
Opened 23 years ago
Closed 23 years ago
Search sidebar compiles result list even when panel is not visible
Categories
(SeaMonkey :: Search, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.7
People
(Reporter: jruderman, Assigned: samir_bugzilla)
References
Details
(Keywords: hang, perf)
Attachments
(2 files)
3.14 KB,
patch
|
alecf
:
superreview+
|
Details | Diff | Splinter Review |
2.50 KB,
patch
|
Details | Diff | Splinter Review |
From bug 77460, buglists hang mozilla for long periods of time using all
available CPU:
dbaron is fixing 77460 by making the search sidebar code more efficient. But
when the search sidebar isn't shown, that code shouldn't be called at all,
because no matter how efficient it is, it's going to slow down the query results
page. (This includes when the sidebar is collapsed, when the sidebar is turned
off, and when a different panel is visible.)
nav triage team:
Marking p3 and mozilla0.9.5
Priority: -- → P3
Target Milestone: --- → mozilla0.9.5
Reporter | ||
Comment 2•23 years ago
|
||
See also bug 53239, alexa "What's Related" panel contacts server even if panel
is not visible.
The checking code should go in here
http://lxr.mozilla.org/mozilla/source/xpfe/components/search/src/nsInternetSearc
hService.cpp#2515
We don't have a service to detect if the sidebar panel is open though
Comment 4•23 years ago
|
||
Note: comments from bug 54542 indicate that with searches for large numbers of
items (like all NEW bugs in bugzilla) can cause a 15 _minute_ freeze.
Changing OS to all. I am voting for this because of the bugzilla buglist issue.
Should be topperf IMO.
OS: Windows NT → All
Reporter | ||
Comment 8•23 years ago
|
||
As long as bug 77460 is open, this bug effectively causes Mozilla to freeze
whenever I look at the UNCO list.
Keywords: hang
Assignee | ||
Comment 9•23 years ago
|
||
Taking.
Assignee: matt → sgehani
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Assignee | ||
Comment 10•23 years ago
|
||
Moving to mozilla0.9.7.
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Assignee | ||
Comment 11•23 years ago
|
||
Assignee | ||
Comment 12•23 years ago
|
||
jruderman, pchen, or morse,
please r.
alecf,
please sr.
Comment 13•23 years ago
|
||
Comment on attachment 57789 [details] [diff] [review]
Don't compute results is search panel isn't open and "auto open search panel" isn't set.
sr=alecf
Attachment #57789 -
Flags: superreview+
Assignee | ||
Comment 14•23 years ago
|
||
*** Bug 108172 has been marked as a duplicate of this bug. ***
Comment 15•23 years ago
|
||
+function isSearchPanelOpen()
+{
+ var isOpen = false;
+
+ if (!sidebar_is_hidden() && !sidebar_is_collapsed())
+ {
+ if (SidebarGetLastSelectedPanel() == "urn:sidebar:panel:search")
+ isOpen = true;
+ }
+
+ return isOpen;
Above simplifies to:
return (!sidebar_is_hidden() && !sidebar_is_collapsed() &&
SidebarGetLastSelectedPanel() == "urn:sidebar:panel:search");
Same comment applies to function SidebarGetLastSelectedPanel
Comment 16•23 years ago
|
||
thats totally unreadable.
Comment 17•23 years ago
|
||
sorry, I didn't offer a better solution though :)
hmm. how about:
function sidebar_is_visible() {
return !sidebar_is_hidden() && !sidebar_is_collapsed();
}
function sidebar_search_is_last_visited() {
return (SidebarGetLastSelectedPanel() == "urn:sidebar:panel:search");
}
...
return sidebar_is_visible() && sidebar_search_is_last_visited();
that reads well, anyway :)
Comment 18•23 years ago
|
||
Well I don't think it totally unreadable! Simple "ands" three booleans.
But I do like your solution better. If samir makes that change, then r=morse.
Assignee | ||
Comment 19•23 years ago
|
||
OK, so what is the cost of making the function calls vs. the if blocks cause we
are trading one for the other?
Assignee | ||
Comment 20•23 years ago
|
||
OK, so I spoke to rogerl about this: he says the cost of two extra function
calls is greater than the cost of the two "if blocks" (even though the current
js inlines "small" functions). So if the two "if blocks" are considered just as
readable as the function calls then we should use my original patch. If we care
more about performance than readability in this case then we should use Steve's
patch. My opinion is that my patch seems like a nice compromise between the
two: it's fairly readable I think.
alecf, morse?
Comment 21•23 years ago
|
||
this isn't called from a loop right? I'd say go with the readable solution
Assignee | ||
Comment 22•23 years ago
|
||
You are right Alec: it isn't called from a loop. The function to update search
results is essentially one of the page load listeners.
Reporter | ||
Comment 23•23 years ago
|
||
If you put a line break between each literal, you can make the single-if-
statement version more readable. For example:
return ( !sidebar_is_hidden()
&& !sidebar_is_collapsed()
&& SidebarGetLastSelectedPanel() == "urn:sidebar:panel:search"
);
By the way, it would be nice if it didn't take three function calls to sidebar
code just to get the answer to "What panel is visited (if any)?".
Reporter | ||
Comment 24•23 years ago
|
||
Fwiw, I think
if (a && b && c)
is easier to read quickly than
if (a && b)
if (c)
In the second, you have to remember that conjunction and nested ifs are
equivalent, and mentally convert the two lines into three nested ifs or a
conjunction of three literals.
Assignee | ||
Comment 25•23 years ago
|
||
Assignee | ||
Comment 26•23 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 27•22 years ago
|
||
mass-verifying claudius' Fixed bugs which haven't changed since 2001.12.31.
if you think this particular bug is not fixed, please make sure of the following
before reopening:
a. retest with a *recent* trunk build.
b. query bugzilla to see if there's an existing, open bug (new, reopened,
assigned) that covers your issue.
c. if this does need to be reopened, make sure there are specific steps to
reproduce (unless already provided and up-to-date).
thanks!
[set your search string in mail to "AmbassadorKoshNaranek" to filter out these
messages.]
Status: RESOLVED → VERIFIED
Updated•16 years ago
|
Product: Core → SeaMonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•