Extends the participants query a bit and only fill "user objects" with uid and name.
This saves a *huge* chunk of queries, especially as we currently don't have a static cache.
The message list is a different beast, that needs to be handled in another issue
| Comment | File | Size | Author |
|---|---|---|---|
| privatemsg.user_load.patch | 1.63 KB | berdir |
Comments
Comment #1
naheemsays commentedTested and works as expected.
Comment #2
timtrinidad commentedIs this going to be committed in an upcoming release?
Comment #3
naheemsays commentedit is part of the plan. More testing however can never hurt.
Comment #4
litwol commentedImmediate perofmrance improvement is minus 2 queries per participant in a thread. However potential imporvement is much greater because we avoid invoking hook_user on load. Also i anticipate bugs like the ones caused by real name module to never happen again :-D. This should force developers use our query builder to extend functionality for users which makes things more controlable on our end... which is good i think.
anyhow. cheers this went in.
Comment #5
naheemsays commentedNice - I especially like that side effect!
Comment #6
litwol commentedin privatemsg_reply()
Comment #7
naheemsays commentedWe will probably need to keep that user_load as we pass the full $user object through the hook_privatemsg_block_message.
Comment #8
timtrinidad commentedThanks!
Comment #9
berdir@6
That is a api function to send messages, we need the user object there for more than just displaying the name. For example, as nbz mentioned, the pm_block_user module expects the roles array to be there.
Can we think/handle these in other issues so that we can set this one to fixed? One other instance where we can probably replace it is in thread list. My current plan is to use the same approach as in #523064: Display tags in thread list, which means to use one single query to load the recipients of the whole list.