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

Slow work without i18n #6

Open
floor12 opened this issue Apr 12, 2019 · 0 comments
Open

Slow work without i18n #6

floor12 opened this issue Apr 12, 2019 · 0 comments

Comments

@floor12
Copy link

floor12 commented Apr 12, 2019

I noticed what if the app does not use i18n at all and app has not any lang files, method ::getLabel() work really really slow, because it tries to find get label with Yii::t(). I noticed this problem in gridView.
I think the right solution is to change
public static $messageCategory = 'app';
to
public static $messageCategory;
and make a check in ::getLabel() method.

I noticed, if i have disabled i18n my yii2 app, much faster use Enum::$list[$id] instead if Enum::getLabel($id). The difference is hundreds of ms.

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

No branches or pull requests

1 participant