View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
19589 | Bug reports | Speed optimization | public | 2024-06-06 11:45 | 2024-08-06 16:55 |
Reporter | DenisChenu | Assigned To | DenisChenu | ||
Priority | none | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.5.x | ||||
Summary | 19589: Multiple call of Survey->find a lot of time | ||||
Description | Wde have a bunck of On each page of survey | ||||
Steps To Reproduce | Steps to reproduceInstall a new master version Expected resultFind it, maybe 4/5 times Actual resultFind it a bunch of time : 131 for Single choice | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 6.5.11 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | not relevant | ||||
Database type & version | not relevant | ||||
Server OS (if known) | not relevant | ||||
Webserver software & version (if known) | not relevant | ||||
PHP Version | not relevant | ||||
tested :
Seems to wok |
|
If you have a chance, it would be interesting to know what would be the query result with my suggested PR to reduce reasonably the calling of survey finds https://github.com/LimeSurvey/LimeSurvey/pull/3819/files I tend to be a bit skeptical about overriding the framework logic. If you have a general knowledge about how the framework works and there is one model where you have overridden it, it might cause problems later in other places. For me it seems more logical to start from fixing bad code and assess the situation after fixing obvious code inefficiency issues. A good example of what I mean is this having a survey find in such a loops can possibly explode these queries. Maybe fixing inefficient code will cut most of the queries so that it will not be that big of an issue any more to fix? |
|
I check the framework logic before. Else “ remove duplicate survey-find-by-pk ” is unrelated since |
|
I confirm Survey::model()->findByPk($this->sid) don't throw again the event : since it use a static variable Without public function getRelated($name, $refresh=false, $params=array()) { : 63 event (on public page : demo survey) |
|
This lower the number of event afterFindSurey too : 2 times on public survey, 63 por more time before (using debug and previous plugin) |
|
Let's discuss |
|
afterFindSurey event questionAdministration/view&surveyid=282267&gid=4&qid=22 without the fix : 6 times Logixc file without the fix : 4 times Really better on public part (happen for each question multiple times) |
|
3 times for admin part seems a constant |
|
I traced this event being mostly triggered from here: Maybe inject languages as a dependency here, the db queries will be gone then, most of them |
|
Both can be interesting : https://github.com/LimeSurvey/LimeSurvey/pull/3871 (I test it with one of my client) |
|
I assign to Carsten maybe ? 2 solution currently :
|
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=36510 |
|
Fixed in Release 6.6.1+240806 |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2024-06-06 11:45 | DenisChenu | New Issue | |
2024-06-06 11:45 | DenisChenu | File Added: Capture d’écran du 2024-06-06 11-37-34.png | |
2024-06-06 11:45 | DenisChenu | File Added: Capture d’écran du 2024-06-06 11-37-43.png | |
2024-06-06 11:45 | DenisChenu | File Added: Capture d’écran du 2024-06-06 11-38-08.png | |
2024-06-06 11:59 | DenisChenu | Category | Other => Speed optimization |
2024-06-06 12:00 | DenisChenu | Note Added: 80229 | |
2024-06-06 12:00 | DenisChenu | Bug heat | 0 => 2 |
2024-06-06 14:43 | TonisOrmisson | Note Added: 80232 | |
2024-06-06 14:43 | TonisOrmisson | File Added: image.png | |
2024-06-06 14:43 | TonisOrmisson | Bug heat | 2 => 4 |
2024-06-06 14:49 | DenisChenu | Note Added: 80233 | |
2024-06-06 15:08 | DenisChenu | Note Added: 80234 | |
2024-06-06 15:08 | DenisChenu | File Added: AfterFindSurveyEventCount.zip | |
2024-06-06 15:17 | DenisChenu | Summary | Multuiple call of same request a lot of time => Multiple call of Survey->find a lot of time |
2024-06-06 15:23 | DenisChenu | Note Added: 80235 | |
2024-06-06 15:23 | DenisChenu | Assigned To | => TonisOrmisson |
2024-06-06 15:23 | DenisChenu | Status | new => ready for code review |
2024-06-06 15:23 | DenisChenu | Note Added: 80236 | |
2024-06-06 15:28 | DenisChenu | Note Added: 80237 | |
2024-06-06 15:30 | DenisChenu | Note Added: 80238 | |
2024-06-06 17:16 | TonisOrmisson | Note Added: 80241 | |
2024-06-06 18:44 | DenisChenu | Note Added: 80242 | |
2024-06-06 18:45 | DenisChenu | Note Edited: 80242 | |
2024-06-12 17:05 | DenisChenu | Assigned To | TonisOrmisson => c_schmitz |
2024-06-12 17:07 | DenisChenu | Note Added: 80280 | |
2024-08-06 14:50 | DenisChenu | Changeset attached | => LimeSurvey master 3163c250 |
2024-08-06 14:50 | DenisChenu | Note Added: 80749 | |
2024-08-06 14:50 | DenisChenu | Assigned To | c_schmitz => DenisChenu |
2024-08-06 14:50 | DenisChenu | Resolution | open => fixed |
2024-08-06 15:17 | tibor.pacalat | Status | ready for code review => resolved |
2024-08-06 16:55 | LimeBot | Note Added: 80754 | |
2024-08-06 16:55 | LimeBot | Status | resolved => closed |
2024-08-06 16:55 | LimeBot | Bug heat | 4 => 6 |