[wp-hackers] Memory spike in comments_template()

Baki Goxhaj banago at gmail.com
Sat Jul 10 09:52:46 UTC 2010


Comments will need enhancement for sure, especially now that bbPress is
becoming a plugin that will use custom post types. This means comments will
need eventually to scale very well and behave nicely in BB mode.

Baki Goxhaj
www.wplancer.com | www.banago.info | www.lintuts.com


On 10 July 2010 07:25, Otto <otto at ottodestruct.com> wrote:

> Agreed, and also there's that line of code in comments_template that's
> been bugging me for a long time:
>
> /** @todo Use API instead of SELECTs. */
>
> Admittedly, I understand why this hasn't been done (it's a lot of
> work), but it does seem like a valid reason to have a ticket in trac
> for it.
>
> -Otto
>
>
>
> On Sat, Jul 10, 2010 at 12:21 AM, Peter Westwood
> <peter.westwood at ftwr.co.uk> wrote:
> > William,
> >
> > Please reopen that ticket and put as much detail on the problem as you
> have discovered.
> >
> > I don't see that the reason for closure on there is necessarily valid -
> we should try and see if we can improve this as.
> >
> > As you rightly suggest we should be able to scale nicely when there are
> alot of comments on a post.
> >
> > --
> > Peter Westwood
> > http://peter.westwood.name
> >
> > On 10 Jul 2010, at 05:30, William Canino <william.canino at googlemail.com>
> wrote:
> >
> >>> I will have to therefore write my own comments_template()....
> >>
> >> ... Writing this turns out to be a complicated mod because the various
> >> comment helper functions and callbacks presume that $comments has all
> >> the comments. :-(
> >>
> >> ----> Well, this means while WordPress is not a blog anymore per se,
> >> WordPress is NOT a discussion forum either, because WordPress doesn't
> >> scale when it has a plethora of comments.
> >>
> >> In the meantime, the palliative that lowered the memory usage by 3MB
> >> is by commenting out "update_comment_cache($wp_query->comments);"
> >>
> >>
> >>
> >>
> >>
> >> On 09/07/2010, William Canino <william.canino at googlemail.com> wrote:
> >>> (I should add that I have threading off.)
> >>>
> >>> Denis-de-Bernardy has declared the issue as wont-fix :-(
> >>>
> >>> https://core.trac.wordpress.org/ticket/8071
> >>>
> >>> I will have to therefore write my own comments_template()....  Does
> >>> anyone have an alternative solution?
> >>>
> >>> W
> >>>
> >>>
> >>> On 09/07/2010, Otto <otto at ottodestruct.com> wrote:
> >>>> On Fri, Jul 9, 2010 at 3:57 PM, William Canino
> >>>> <william.canino at googlemail.com> wrote:
> >>>>> <!-- BEFORE: 25033360 -->
> >>>>> <!-- START: 33953448 -->
> >>>>> ... (comments go here) ...
> >>>>> <!-- END: 36172480 -->
> >>>>> <!-- AFTER: 36113680 -->
> >>>>>
> >>>>> The memory usage jumped 8.5 megabytes between BEFORE and START.
> >>>>>
> >>>>> Do I really have to move out some of the older comments of this blog
> >>>>> post?  Is there another solution?
> >>>>
> >>>> Comments don't get pulled out of the database until the
> >>>> comments_template function is called, so that basically means you've
> >>>> got 8+ meg of comments on the post in question.
> >>>>
> >>>>
> >>>> -Otto
> >>>> _______________________________________________
> >>>> wp-hackers mailing list
> >>>> wp-hackers at lists.automattic.com
> >>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> >>>>
> >>>
> >>
> >>
> >> On 09/07/2010, William Canino <william.canino at googlemail.com> wrote:
> >>> (I should add that I have threading off.)
> >>>
> >>> Denis-de-Bernardy has declared the issue as wont-fix :-(
> >>>
> >>> https://core.trac.wordpress.org/ticket/8071
> >>>
> >>> I will have to therefore write my own comments_template()....  Does
> >>> anyone have an alternative solution?
> >>>
> >>> W
> >>>
> >>>
> >>> On 09/07/2010, Otto <otto at ottodestruct.com> wrote:
> >>>> On Fri, Jul 9, 2010 at 3:57 PM, William Canino
> >>>> <william.canino at googlemail.com> wrote:
> >>>>> <!-- BEFORE: 25033360 -->
> >>>>> <!-- START: 33953448 -->
> >>>>> ... (comments go here) ...
> >>>>> <!-- END: 36172480 -->
> >>>>> <!-- AFTER: 36113680 -->
> >>>>>
> >>>>> The memory usage jumped 8.5 megabytes between BEFORE and START.
> >>>>>
> >>>>> Do I really have to move out some of the older comments of this blog
> >>>>> post?  Is there another solution?
> >>>>
> >>>> Comments don't get pulled out of the database until the
> >>>> comments_template function is called, so that basically means you've
> >>>> got 8+ meg of comments on the post in question.
> >>>>
> >>>>
> >>>> -Otto
> >>>> _______________________________________________
> >>>> wp-hackers mailing list
> >>>> wp-hackers at lists.automattic.com
> >>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> >>>>
> >>>
> >> _______________________________________________
> >> wp-hackers mailing list
> >> wp-hackers at lists.automattic.com
> >> http://lists.automattic.com/mailman/listinfo/wp-hackers
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list