user_stats_get_stats() is used to retrieve user data for use in say forum displays. From what I can gather and from my own use of it, I can use this function in my theme to extract out various user-related data. This function calls user_load on every invocation and as user_load is not cached normally, I made some modifications you can see in the attached patch to call user_load only once per page load per user.

CommentFileSizeAuthor
user_stats.module.patch570 bytesjaydub

Comments

liam mcdermott’s picture

I rolled your patch in with a bunch of other changes made last night. I know that's probably bad practice, but hey-ho. :)

Am going to have to test this thoroughly on a forum topic with 300 replies on the same page. Am worried that amount of caching will cause PHP to run out of memory.

Will leave this bug open until testing is complete. Although, the changes are in the packaged version on the project page, so feel free to grab it and test.

liam mcdermott’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.