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
cache the language files in one big file (Trac #2877) #2877
Comments
Attachment added by trac user coldtrick on 41109861-05-06: languages.php |
brettp wrote on 41110567-04-11 Thanks for taking the time to research this. I've attached a patch file for only the changes. Looking at how you're storing the file, did you find that your method of storing the file by creating actual PHP code is faster than serializing the array? |
Milestone changed to |
Attachment added by brettp on 41110573-03-14: 2877_languages.patch |
trac user coldtrick wrote on 41110575-01-14 we made it a PHP file so that we could use the core functions to read the language in the file. we didn't check if there was a better way to store it. |
ewinslow wrote on 41973544-07-15 Interested in this. Caching the final array seems like a very good idea. |
Milestone changed to |
Milestone changed to |
trac user sembrestels wrote on 42036582-03-31 Each language should be loaded when it is necessary. Usually only one language per page is needed, sometimes more, when you use the third parameter of elgg_echo, but not all languages per page. Doing a cache per language and loading it when it is needed will improve performance a lot. |
cash wrote on 42036676-09-16 I agree that we should have one file per language. |
trac user coldtrick wrote on 42038045-08-19 Replying to sembrestels:
As stated in the start of this ticket you should have one file per language. |
Original ticket http://trac.elgg.org/ticket/2877 on 41109860-03-27 by trac user coldtrick, assigned to cash.
Elgg version: 1.7
One of our clients had a lot of performance issues on their Elgg 1.7.1 installation.
After we did some research we found that the loading of languages takes up a lot of time.
We decided to cache the loaded languages in one large file (per language) and this decreased the loading time of pages by 30%-50%.
To test that there is a problem load the core language file 100 times. All the time goes into add_translation, since this is an array merging.
As the languages on a running site don't change (all that much) why not cache them like simplecache.
Attached you'll find a file how we did it on an Elgg 1.7.1 installation. It isn't the nicest code but it should give a direction, and it works.
The text was updated successfully, but these errors were encountered: