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

Improve BO speed by removing menu images #8780

Merged
merged 2 commits into from
Mar 16, 2018
Merged

Improve BO speed by removing menu images #8780

merged 2 commits into from
Mar 16, 2018

Conversation

alegout
Copy link
Contributor

@alegout alegout commented Feb 20, 2018

Questions Answers
Branch? 1.7.3.x
Description? Improve speed by removing menu images, apparently not used by us. Maybe contributors? -72% on blackfire and /product/catalog page
Type? improvement
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? no
How to test? profile BO pages.

Important guidelines


This change is Reviewable

@alegout
Copy link
Contributor Author

alegout commented Feb 20, 2018

capture d ecran 2018-02-20 a 20 27 49

@alegout
Copy link
Contributor Author

alegout commented Feb 21, 2018

Another file_exists call we can remove after for the image.

@alegout
Copy link
Contributor Author

alegout commented Feb 21, 2018

Now:

capture d ecran 2018-02-21 a 10 06 47

$path_img = _PS_MODULE_DIR_.$tab['module'].'/'.$tab['class_name'].'.png';
// Relative link will always work, whatever the base uri set in the admin
$img = '../modules/'.$tab['module'].'/'.$tab['class_name'].'.png';
}
Copy link
Member

Choose a reason for hiding this comment

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

By seeing these lines removed, I'd say you remove a feature.
Module developers can add their AdminModuleController tab icon in the root folder of their module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but is this really used and needed?

Copy link
Member

Choose a reason for hiding this comment

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

(Forwarded an email about that)

@kpodemski
Copy link
Contributor

kpodemski commented Feb 21, 2018

Images are not used from version 1.5 of PrestaShop, of course you could add them but it's a common to use font-icons now instead, for me it's a good change 👍

@alegout
Copy link
Contributor Author

alegout commented Feb 21, 2018

Ok cool, thanks for you answer @kpodemski.

And in fact, more you have links in the menu (installed module, etc...) more you gain speed.

@kpodemski
Copy link
Contributor

Yeah, totally, also - if someone still want to use an image, there's still an option to do that via CSS, so you shouldn't worry about acceptation of this PR @Quetzacoalt91 ;)

@Quetzacoalt91
Copy link
Member

Quetzacoalt91 commented Feb 21, 2018

But you know we have to respect the semver rules, we cannot remove features like this in a patch version (1.7.3.0 won't have this PR, even if we approve it immediately).

I know the consequences may be awesome, but the module related code is the only one I'd keep, because we can't breaks things for our contributors without prior notice.

@kpodemski
Copy link
Contributor

kpodemski commented Feb 21, 2018

Ok, but this feature is not available anymore since... i don't remember :D You can try to add this image and you will not see it in back-office anyway... so yeah, we scan for the images but those images are not displayed...

@eternoendless
Copy link
Member

I think that if we ever decide to keep this feature it should be done via config instead of via filesystem probing, because as blackfire shows, it's extremely slow :)

@eternoendless eternoendless added the Waiting for PM Status: action required, waiting for product feedback label Feb 21, 2018
@alegout
Copy link
Contributor Author

alegout commented Feb 21, 2018

Even if a module has an image, we don't use it in the template file.
So i think it's safe... For me, module image feature is broken since we removed it in the template?

@eternoendless eternoendless added this to the 1.7.3.1 milestone Feb 21, 2018
@Quetzacoalt91
Copy link
Member

Both SF and legacy?

@kpodemski
Copy link
Contributor

@alegout exactly, it's not used anymore for years...

@Quetzacoalt91 yes, it's not used anymore, even in PrestaShop 16...

Copy link
Member

@Quetzacoalt91 Quetzacoalt91 left a comment

Choose a reason for hiding this comment

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

Go on then, I'll trust what you guys say.

@alegout
Copy link
Contributor Author

alegout commented Feb 21, 2018

yes @Quetzacoalt91 checked in legacy and SF themes.

@kpodemski
Copy link
Contributor

kpodemski commented Feb 21, 2018

@colinegin colinegin added PM ✔️ Status: check done, behavior approved and removed Waiting for PM Status: action required, waiting for product feedback labels Feb 21, 2018
@eternoendless eternoendless added the Waiting for QA Status: action required, waiting for test feedback label Feb 21, 2018
Copy link
Contributor

@mickaelandrieu mickaelandrieu left a comment

Choose a reason for hiding this comment

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

As it's part if AdminController, this have a positive performant interest for every page of back office :-)

👍 for me too, maybe explain what need to be tested can help for QA validation ;)

@marionf marionf added QA ✔️ Status: check done, code approved and removed Waiting for QA Status: action required, waiting for test feedback labels Mar 13, 2018
@eternoendless
Copy link
Member

Thank you @alegout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PM ✔️ Status: check done, behavior approved QA ✔️ Status: check done, code approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants