Res facta quae tamen fingi potuit (pauamma) wrote in lj_dev,
Res facta quae tamen fingi potuit

Performance issue in memcache userpic handling

Passing this on, first spotted by exor674 on Dreamwidth, who says:
I think I should report this bug I came upon while looking at the code however it causes no user-facing issues.
This bug is not causing any visible issues but is potentially a performance issue. lines 302 through 346

On allpics.bml page and /data/userpics, those pages will always hit the database and never use memcache.
The picture URL field is seemingly never used,and when there are no URLs the value in the memcache key upicurl:$userid will be '', which is false, so the database will always be hit.

This will also happen for any user (without comments on *any* of their userpics) that has an entry or comment on an S2-styled page.
No comments on any userpic will make the upiccom:$userid value be '', and will cause the database to always get hit.

The code should use if ( defined( $comminfo ) ) on 309
and if ( defined ( $urlinfo ) ) on 331

Thank you.
Patch available at for however long that service keeps pastes. Batteries not included. Content may settle during shipment. Keep out of reach of children. Not responsible for any damage. Some assembly required. Etc.
Tags: *announce, bugs, bugs: memcache, bugs: userpics

  • LJ Picture Uploader

    Hello, guys! Lately I made a program to upload pictures on LJ server ( Page on SoftPedia). It's quite simple at look and same simple in use, so hope…

  • new Oragir v0.2 beta

    oragir v0.2 beta the second beta version is released. there are following features and changes: can download the whole journal from LJ server and…

  • Alternative multipltform client for LiveJournal web-based service

    Oragir project implements an alternative multipltform client for LiveJournal web-based service. In contrast to other clients that allow reading and…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded