Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 06, 2014 @ 01:26
    Nicholas Westby
    0

    uCommentsy "Comments" Dashboard Unusably Slow

    I have been waiting for the "Comments" dashboard to load for about 20 minutes now (my site has 1,000+ nodes), and my CPU has been at 50% the entire time. I suspect the problem is that you are using the ContentService here: https://bitbucket.org/anthonydotnet/ucommentsy/src/ac4be9e4b68428419fae78c20af514a6e0362b65/Source/uCommentsy.Web/usercontrols/uCommentsy/Dashboard/admin.ascx.cs?at=default#cl-91

    You seem to realize this based on your comment here: http://our.umbraco.org/forum/developers/api-questions/42835-Umbraco-6-ContentService-API-or-Examine

    Is the current solution just to disable the dashboard entirely? So a user would have to rely on email notifications about submitted comments to know which ones to publish in the content tree (it seems that "approving" a comment can be achieved by publishing it)?

    As a recommendation, perhaps you could listen to content creation events and if the created content node is a comment, add that to a queue (some sort of storage area that would persist across application restarts). You could then use that queue to populate the list of unapproved comments rather than scanning the entire tree each time the user loads the "Comments" dashboard tab.

    Umbraco 7.1.4. As you are aware, uCommentsy doesn't work with this version of Umbraco, so I am using a custom compiled version that does.

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Sep 07, 2014 @ 00:55
    Anthony Dang
    0

    Hi

    You're definitely right. Examine would be much more efficient. It's something I havent considered doing in the past, as it was just the backoffice. I thought a tiny bit of slowness was acceptable. But you've got more than a tiny bit of slowness.

    If you've got the time to spare, you could add a custom examine field called "approved", and then use examine in the dashboard control.

    You could do a pull request too ;)

     

     

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 07, 2014 @ 02:28
    Nicholas Westby
    0

    Do you accept pull requests? I see somebody submitted one last year for a very similar issue/fix, but you haven't merged it in yet (or declined it): https://bitbucket.org/anthonydotnet/ucommentsy/pull-request/1/speed-up-landing-page-search/diff

    By the way, I don't see why I'd need an "approved" field. In theory, I could just use Examine to find all comment nodes, then any that aren't published (i.e., any that return null from UmbracoHelper.TypedContent) would be considered not yet approved (those are the ones I could show in the dashboard).

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Sep 07, 2014 @ 15:41
    Anthony Dang
    0

    Holly cow!

    That didnt show up on my bitbucket dashboard!

    Regarding the approved field... the reason I would add the flag is if you have 10,000 comments, and only 1 of them is unpublished, then you must instantiate all of them to find the one that isnt unpublished. 

    In fact, it may actually be better to always publish the comment, but set a flag for "visible/approved".

     

     

     

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Sep 07, 2014 @ 17:46
    Anthony Dang
    0

    I've merged that fix. It should at least fix the initial load issue.

    The search for unpublished comments, is still going to be slow for large sites until lucene is added.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 10, 2014 @ 19:57
    Nicholas Westby
    0

    Here you go: https://bitbucket.org/anthonydotnet/ucommentsy/pull-request/2/fix-for-slow-comment-approval-dashboard

    The dashboard is now super fast on my site with something like 1,500 nodes.

    I made the commit to the Umbraco 6 branch, as that was the branch that contained the other commit. I modified a few things locally to make it work with Umbraco 7, but the commit only contains the changes necessary to speed up the dashboard. Also, I didn't use Examine for the initial load, but since you already pulled in that other request to use Examine for the initial load, I left that unchanged (my local version just uses IPublishedContent extension methods since it seems like a reasonable assumption that uCommentsyConfiguration nodes should be published).

Please Sign in or register to post replies

Write your reply to:

Draft