-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed performance on the Modules listing page /admin/modules #5046
Comments
Interesting... I could verify this with debug():
Although Changing For what it's worth, if I change it to What's so problematic with "system_rebuild_module_data", that it breaks the static cache? Can someone with better knowledge of the backdrop_static cache shed a light on this, please? |
Ha! There it is: https://github.com/backdrop/backdrop/blob/a259d2d276e5f43db925a408a2f06944eee25324/core/includes/module.inc#L230 The cache is ineffective, because it gets reset. |
@alanmels I would look for calls to |
@indigoxela jinx! 😆 |
...I was looking through d.org issues like the following:
|
...it seems quite likely to me that we may be too overzealous at some place, and we might be doing |
This is an interesting conundrum here. I have no clue how to resolve this. FYI since it hasnt been explicitly stated, |
Thank you for the inputs. It seems there is more here than just replacing a single string. I'm not sure anymore what would be the ideal fix, but let's get this - seemingly long time D7 problem - finally fixed. |
I've reverted the change I made, then commented out the |
Same here. Seems like a catch 22. |
...I just compared |
@klonos, that would be nice if it really helps. However, we all know some issues on D take forever to be properly resolved. It's basically the same issue that you've referenced earlier https://www.drupal.org/project/drupal/issues/794936, however it was for D6, never resolved and now is closed. Another pointer that could help: the |
Interestingly, the And, if the function serves not only the modules, but also the themes page then the naming is controversial - maybe something like |
@klonos Waiting for Drupal to resolve something means waiting for a long time, potentially forever. I wouldn't rely on that. @alanmels Whatever we figure out as a solution, two things are important:
And now I'm curious, who can solve our nice little catch 22. 😏 |
I never implied to wait for this to be fixed in D7. Just to start a discussion there, and see if more brainpower can help come up with a solution.
I agree with both these points ^^ ...and we have a place to discuss trying to bring consistency to these functions: #2548 |
admin/modules - unlike the .../list page this page runs system_rebuild_module_data twice, the tracebacks are:
^^ The first of the above calls does not happen on admin/modules/list. |
So since |
@indigoxela, while I agree that, if ever, the change in the function's name must be done with caution:
the Generally and not only for this specific case, I wish Backdrop community were bolder to make changes in core that make sense sooner then leaving them hanging around for years as it often happened for Drupal 6/7.
Isn't it broken already? As I noted in the very beginning the |
I'm a bit surprised that |
Just place
and you will see duplicated output on |
@docwilmot look at my previous comment. I did a debug_backtrace() in function system_rebuild_module_data() and extracted the functions that led there to display the trace with debug(). I'm not sure if there's a way to fix that, which isn't too radical. Didn't dig deeper yet, though. |
@alanmels our first principle is backwards compatibility: https://backdropcms.org/philosophy#principles We cannot remove/rename functions, but what we can do is introduce new ones with the proper names, and then have the old ones "redirect" to the new ones, along with a |
Not sure if it helps, but the double call to function system_rebuild_module_data() is caused by update_init(). Potentially a small change there could fix the problem, but that needs more recherche. |
I filed a new issue to discuss refactoring when we show update notifications at #5083. |
@quicksketch I supposed there is a reason behind @docwilmot's insisting on his take of the issue, but really wanted to see some kind of proof-case. Which you've given on backdrop/backdrop#3600 (comment) with plenty of details. Still I find your alternative suggestion to solve this much appealing: displaying update messages on the Available Updates and the Status page would be just enough as users never go to the Modules page to check updates, but other reasons as enabling, disabling, reviewing the modules. |
Code in backdrop/backdrop#3601 looks good to me 👍🏼 |
...not sure how to best test this 🤷🏼 ...do we need to install heaps of modules, and then benchmark how fast the modules pages loads before/after the fix? |
We just need to test that the static cache on |
@klonos - Can an issue be RTBC and "PR-Needs Testing"? |
@stpaultim yes. The RTBC acronym has 2 meanings:
My understanding is that one person can review the code, and if no issues are found with coding standards, and it makes sense, they can mark it as RTBC. Another person can then do the manual testing, and add the WFM label. |
@klonos - I see that the logic. However, I find it very confusing. Because, how can something be "Ready to be Committed" if it hasn't been tested yet. I've always assumed that the "RTBC" should only be applied after "PR-Works for Me." Until we an issue is marked "Works for Me," we can't really be sure that the code is final yet, let alone RTBC? (I moved this discussion to here: backdrop-ops/backdrop-community#13) |
Since there are two open PRs, and some discrepancy between whether one of the PRs is actually ready to be committed or not, I'm removing the RTBC label. |
Instructions for quick test right here: #5046 (comment) |
This was meant to be a quick simple fix, can we get an RTBC for this please? DOnt think it even needs testing manually TBH. |
Per my comment above I've closed backdrop/backdrop#3593 for the more conservative approach in backdrop/backdrop#3601. I QA'd this out-of-box and found a modest performance improvement even without any additional modules. Before patch, caches set: 98.45 ms Before patch, no caches: 113.77 ms I timed these simply with the Devel page timer. These times seemed pretty consistent across 3 consecutive tests, an improvement of 50% when caches are set and an improvement of 30% when caches are empty. |
I merged backdrop/backdrop#3601 into 1.x and 1.20.x. Thanks @docwilmot, @alanmels, and @indigoxela for the different approaches and PRs! Thanks @hosef and @klonos for their reviews and feedback. |
Description of the bug
I've been always bothered by how quickly the Functionality (admin/modules) page gets really slow with larger number of contributed modules enabled. So I decided to find out the culprit.
Steps To Reproduce
system.module
, find thesystem_rebuild_module_data()
function and putsdpm($modules_cache);
like so:Refresh the modules page and see
$modules_cache
always returns empty, so the if condition further below is completely useless.However, caching for the modules page starts working as expected if the
$modules_cache = &backdrop_static('__FUNCTION__');
is replaced with$modules_cache = &backdrop_static('modules_cache');
like so:Finally, I have really fast Modules page.
To describe the problem: Two modules try to reset the caches on /admin/modules.
To my understanding this happened by mistake (many years back) and should get fixed, so that only the module that's responsible for that page flushes caches on that page.
PR by @docwilmot backdrop/backdrop#3601
The text was updated successfully, but these errors were encountered: