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 issue #CT-652: system slowness when saving survey settings #3740
base: master
Are you sure you want to change the base?
Conversation
@@ -837,9 +837,11 @@ public static function getQuestionXMLPathForBaseType($type) | |||
{ | |||
static $questionThemeCache = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dislike to use Cache for Static var … Static is not caching ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah makes sense, cant use it everywhere php will run out of memory eventually when we use it to much. Will look at yii's caching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently : it's a static var :). I don't ask to put it in cache (maybe in future), just more clear name :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also propose the creation of a protected static $questionThemeCache = [];
data member to make the file more readable and the cache more accessible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected static $questionThemeStatic = []
;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check more on
if (!empty($this->currentGroupSeq) && $this->currentGroupSeq > 0) {
Something like
if($surveyId && LimeExpressionManager::getLEMsurveyId() == $surveyId && (!empty($this->currentGroupSeq) && $this->currentGroupSeq > 0 ) {
It was call without qid on setVariableAndTokenMappingsForExpressionManager
And this function is used in Logic file.
(updated to comment : think it can show not remlated Group question in Admin part.
I public part : it's always OK, and can really improve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I would avoid using static
variables for caching.
@@ -837,9 +837,11 @@ public static function getQuestionXMLPathForBaseType($type) | |||
{ | |||
static $questionThemeCache = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also propose the creation of a protected static $questionThemeCache = [];
data member to make the file more readable and the cache more accessible.
It's not caching, it's static . Reason why i ask renaming ;) |
…t of saving survey settings and loading groups in survey taking
@@ -2,6 +2,8 @@ | |||
|
|||
namespace LimeSurvey\Models\Services; | |||
|
|||
use QuestionTheme; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use QuestionTheme here?
No description provided.