Skip to content
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

yii\base\Module createControllerByID add cache #20115

Closed
wants to merge 2 commits into from

Conversation

easydowork
Copy link

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues #20114

Copy link

what-the-diff bot commented Feb 11, 2024

PR Summary

  • Enhanced Caching Mechanism in Module.php
    The update in this file involves the addition of a caching feature to the createControllerByID method. The method initially checks whether there's a cache present for a given ID. If the cache doesn't exist, it continues with the standard procedure. On the other hand, if the cache is present, it retrieves the associated class name. It then verifies whether the class name exists and certifies that it is a subclass of yii\base\Controller. This enhancement is designed to improve the retrieval speed of information, making our services more efficient.

Copy link

codecov bot commented Feb 11, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (0027227) 48.02% compared to head (29567a9) 48.02%.

Files Patch % Lines
framework/base/Module.php 82.60% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #20115   +/-   ##
=======================================
  Coverage   48.02%   48.02%           
=======================================
  Files         445      445           
  Lines       43892    43900    +8     
=======================================
+ Hits        21080    21084    +4     
- Misses      22812    22816    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Webkadabra
Copy link

I sure hope no one is seriously thinking adding this PR into codebase, this is type of stuff that may kill the framework

@easydowork
Copy link
Author

I will do a simple test, using the microtime (true) function to calculate the difference, and replacing preg_replace_callback with cache in the createControllerByID function does indeed improve the calculation time, but it increases the complexity and instability risk of the system. So I gave up.

@easydowork easydowork closed this Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants