-
-
Notifications
You must be signed in to change notification settings - Fork 772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser locks/freezes with many roster users #151
Comments
I've found the likely cause for this. A regression in RosterView which results in roster contacts being sorted too frequently (once for every contact instead of once for all of them). I came across this while doing some refactoring for #83 and commit 04d2b3a contains a fix. I stumbled across this while working on something else, so it wasn't feasible to create a separate patch/commit just for this issue. |
i have similar problem, my server has 3000 users, and loading all online and offline lock browsers and freezes , in #205 i request a feature as possible solution, only loading online users! |
The RosterView view is now an overview of RosterGroup objects. RosterGroup objects each have their own collection of contacts which fall under that group. Additionally, the RosterView has a collection of all contacts. The comparator of RosterContacts is now used to correctly position roster contacts and we therefore no longer need to explicitly sort them afterwards. updates #83 updates #151
@camaran and @mckaygerhard Can you check whether this is still a problem with the 0.8 release? |
hi @jcbrand i can tested but in two weeks, due i'm very busy now.. also i must to adapt to the mail service due my interes its the mail integration, i cannot said something now, alone, the converse.js works pretty good now. due i cannot reopens this issue, if still happen, i'll open new issue about it or notify to u to reopen this |
thanks @mckaygerhard |
I can confirm this issue still happening for me. Im using v0.8.1, will try upgrading to 0.8.3 and see if it helps. Thanks, awesome job :) |
Hi @jcbrand , i've tracked down the issue to the rosterHandler function. Im not able to identify why though, still going through the code. Thanks! |
rosterHandler is called as a callback from Strophe. Right now i have make it check if the 2nd argument is undefined, if it is i just loop through all items, but if its not i only update that particular roster item. rosterHandler: function (items, item) {
converse.emit('roster', items);
if (typeof item !== 'undefined') {
items = [item];
} else {
this.clearCache(items);
}
// the rest of the function Hopefully im understanding it correctly and this doesn't break anything else, lol. |
Excellent! Thanks for investigating this @juanpborda I'm not sure whether there will be any side-effects, we'll have to check. Will you make a pull request with your changes? In a similar vein, the I actually think that both strophe.muc and strophe.roster can be removed as dependencies and instead their functionality should be implemented inside converse.js itself. (Additionally, converse.js should be made more modular, but that's a different story). The reason for this, is that both these libraries implement their own data structures for modeling and storing data (such as roster contacts), and then converse.js duplicates all that effort by again putting this data into Backbone.js models. Converse.js's models are the desired ones however, because they have automatic syncing with browser storage and automatic updating of DOM elements (via views). So there is a duplication going on there, and this duplication is exactly the reason for the |
i then test again using lasted git from here and get many errors on js loading.. on firefox i got: Error: extStatus is not a function on chrome/chromium i got a jquery.timepicker error the log bosh are: Request URL:http://domain.net.ve/http-bind/ |
@jcbrand Sorry for the delay, hard week.. Best regards. |
hello @juanpborda i ask if u'r browser are lock only when loading ¡? my browser only lock when load the users, lock for about 20 seconds on a celeron older machine and for about 8 seconds on a dual core 2.2 GHz cpu machie with recents browsers both for me, the lock only happened with loading users (on each refresh) |
@mckaygerhard jquery.timepicker and priv.js are not used or required by converse.js. Looks like your problems lie elsewhere. |
i removed the jquery and related jquery artifacts.. but error still persis, now i not get any error, event in the prebind debug info on chromium.. |
@juanpborda How's it going with that pull request? |
@juanpborda I tried your solution of modifying the rosterHandler but the result was that the roster contacts in each group were only sorted alphabetically; presence sorting did not occur. Have you experienced that as well? Any other solutions? Thanks! |
This should now be fixed in the latest code in master. |
@jcbrand Bad news is this still an issue with latest version. Is there any undesired side effect if only calling clearCache if item is undefined? @someone3210 I havent got the issue you mentioned, but i dont use groups so i really wouldn't know. |
Here's a Chrome CPU Profiling (we talked at Prosody's chat) Im using Chrome 39 on Win7 x64. Havent tested another browser |
@juanpborda As you can see, only 5% of the time is spent in However, your idea of only calling Almost half of the time is spent in What you can try right now, is to set |
Is there any way to disable sorting? ps: This is the |
No.
Looks like So, 5% of total time was spent in One improvement that can be made here, is to call |
Does That's why for me it makes sense to only iterate once.
Then its calling (Sorry for these reports, im aware they are barely readable... This is really difficult to explain). Adding this improved the performance: if (!item) this.clearCache(items); Still looking on how to further optimize. Do you think there would be any benefit or undesired side effect if instead of clearing the cache, you just replace it with whatever Thanks a lot for you help! |
_.pluck was being called inside the form loop.
Yes. The items change when a roster contact removes you from their roster. I've made a commit to at least stop calling To really fix this, strophe.muc needs to be removed and instead the roster code needs to be rewritten inside converse.js using the same Backbone models. cc @juanpborda |
with 500 user in the roster converjs lock the browser
The text was updated successfully, but these errors were encountered: