Closed
Bug 953721
Opened 11 years ago
Closed 9 years ago
Nicklist painfully slow
Categories
(Instantbird Graveyard :: Conversation, defect)
Instantbird Graveyard
Conversation
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: florian, Assigned: benediktp)
References
Details
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
*** Original post on bio 276 at 2009-12-01 17:13:00 UTC ***
*** Due to BzAPI limitations, the initial description is in comment 1 ***
Reporter | ||
Comment 1•11 years ago
|
||
*** Original post on bio 276 as attmnt 253 at 2009-12-01 17:13:00 UTC ***
When joining a chat room with thousands of participants (for instance, #ubuntu
on irc.freenode.net) the application is frozen for about a minute!
So, 2 ways to attack the issue:
- delay and split in small portions (100ms max) the initialization of that
listbox.
- reimplement the listbox using a <tree> XUL element and an nsITreeView so
that the time becomes O(n) instead of O(N) (n and N being respectively the
number of visible nicks and the total number of nicks in the list).
Details that need to be handled for the second approach:
- having a column for the 'status' icons (op/voice/...). Clicking on the
column headers can change the sort direction (would fix bug 953656 (bio 210)).
- the JS function that computes the color for a nick should be called lazily,
and the result should be cached. It's not totally clear to me yet how we can
set the text color for a tree row dynamically, but I guess we can figure out
that.
I'm attaching the beginning of a work in progress patch.
I intended to work on this following these steps:
- insert a tree in the conversation binding, with an associated nsITreeView
containing static data. (done in the attached WIP)
- create a correct nsITreeView object representing the actual data.
- figure out how the icons can/should be displayed
- figure out a way to display nick colors
- handle sorting the list differently based on clicks in the tree column
headers.
I'm not going to work on this in the near future, so anybody should feel free
to take this work where I left it, or start from scratch if that's more
appropriate.
Reporter | ||
Updated•11 years ago
|
Whiteboard: [0.2-wanted]
Reporter | ||
Comment 2•11 years ago
|
||
*** Original post on bio 276 at 2010-01-20 17:45:45 UTC ***
(In reply to comment #0)
> - figure out a way to display nick colors
Dynamically inserting CSS rules for a tree was dealt with in this blog post:
http://dafizilla.wordpress.com/2010/01/08/how-to-programmatically-change-xul-trees-pseudo-classes/
A comment says that Fennec does something similar by:
> 1. Grab the first stylesheet and add a rule http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#381
> 2. Edit the style property with your changes http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#405
The interesting linked code is:
1. To prepare the style rules:
let stylesheet = document.styleSheets[0];
for each (let style in ["window-width", "window-height", "toolbar-height", "browser", "browser-handheld", "browser-viewport"]) {
let index = stylesheet.insertRule("." + style + " {}", stylesheet.cssRules.length);
this.styles[style] = stylesheet.cssRules[index].style;
}
2. To dynamically change style rules:
Browser.styles["window-width"].width = w + "px";
Browser.styles["window-height"].height = h + "px";
Browser.styles["toolbar-height"].height = toolbarHeight + "px";
Browser.styles["browser"].width = kDefaultBrowserWidth + "px";
Browser.styles["browser"].height = scaledDefaultH + "px";
Browser.styles["browser-handheld"].width = window.screen.width + "px";
Browser.styles["browser-handheld"].height = scaledScreenH + "px";
Assignee | ||
Updated•11 years ago
|
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → benediktp
Status: NEW → ASSIGNED
Whiteboard: [0.2-wanted]
Comment 3•11 years ago
|
||
*** Original post on bio 276 at 2011-08-30 16:37:22 UTC ***
(In reply to comment #0)
> - delay and split in small portions (100ms max) the initialization of that
> listbox.
See http://log.bezut.info/instantbird/110826/#m549 about some steps to do this:
> adding an executeSoon call every 100 nicks displayed would be enough
Assignee | ||
Updated•11 years ago
|
Status: ASSIGNED → NEW
Comment 4•9 years ago
|
||
I think this was fixed a long time ago. (Though of course it could always be better ;) )
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•