Closed (fixed)
Project:
Real Name
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2009 at 12:52 UTC
Updated:
17 Jun 2010 at 07:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
maximpodorov commentedCan it be a possible solution?
Comment #2
nancydruI'd like to see some testers.
Comment #3
maximpodorov commentedWorks for me :)
Really, it reduces query count significantly.
Comment #4
nancydruThere will be a new release on Wednesday; are you willing to bet that this can be included without breaking stuff?
The next tester can mark this RTBC.
Comment #5
bcn commentedthis patch no longer applies.
Comment #6
maximpodorov commentedThis patch applies to the current dev version. It includes commenting out the line which addresses the static array $links which is defined in other function. I hope someone will have enough time to return the functionality of homepage calculation when the data is taken from the static cache. After that, this fix will be completed.
Comment #7
maximpodorov commentedAny news for this problem fixing?
Comment #8
msonnabaum commentedHere's a different approach that I think works a bit better. It also should take care of the homepage issue.
It adds a D7-style central static cache so that statically cached variables can be shared across functions. This approach simply allows realname_make_name and _realname_make_name to use the same cache, so the existing logic works as expected.
This patch only addresses the one issue, but I imagine the central static cache, once committed, could be used in other places as well.
Comment #9
gausarts commentedSubscribing. Thanks
Comment #10
bcn commentedToo much whitespace here, but otherwise I think this patch looks good. Attached patch fixes this space issue, but is otherwise identical.
Thanks!
Powered by Dreditor.
Comment #11
gaellafond commentedExcellent!
After enabling devel query module, I found that RealName was generated a lot of queries. Most of them are due to a simple typo:
http://drupal.org/node/805526
And the rest are due to the broken caching system that you solve here.
Your cache function is a copy of &drupal_static() for D7:
http://api.drupal.org/api/function/drupal_static/7
May I suggest you to call the function drupal_static and define it like this:
That way, if we forget about this function when the module will be port to D7, this part of the module will still works in harmony with Drupal core.
Thanks for that Patch!
Comment #12
nancydruCommitted to 6.x-1.x-dev.
@gaellafond: good suggestion.
Comment #13
voxpelli commented@gaellafond: For future reference - conditional functions in php are not very good from a performance perspective - so what you suggest should be avoided - instead just note that the function should be replaced with drupal_static() once the module gets updated to D7.