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

Fixed issue #CT-652: system slowness when saving survey settings #3740

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ptelu
Copy link
Contributor

@ptelu ptelu commented Feb 15, 2024

No description provided.

@@ -837,9 +837,11 @@ public static function getQuestionXMLPathForBaseType($type)
{
static $questionThemeCache = [];
Copy link
Collaborator

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 ;)

Copy link
Contributor Author

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

Copy link
Collaborator

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 :)

Copy link
Contributor

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protected static $questionThemeStatic = [] ;)

Shnoulle

This comment was marked as duplicate.

Copy link
Collaborator

@Shnoulle Shnoulle left a 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.

@Shnoulle Shnoulle self-requested a review February 15, 2024 18:08
Copy link
Contributor

@lajosarpad lajosarpad left a 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 = [];
Copy link
Contributor

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.

@Shnoulle
Copy link
Collaborator

This looks good, but I would avoid using static variables for caching.

It's not caching, it's static . Reason why i ask renaming ;)

@@ -2,6 +2,8 @@

namespace LimeSurvey\Models\Services;

use QuestionTheme;
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants