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

very big performance issue with this theme framework on IIS and PHP 5.4 - SOLVED! #1

Closed
simllll opened this issue Oct 27, 2013 · 2 comments

Comments

@simllll
Copy link

simllll commented Oct 27, 2013

I just wanted to let you know that I had a very big performance issue with this template, it took me a while to narrow down the reason for it and I thought I will let you know about it to solve it for future updates.. (well and also improve the performance for every one else..)

I'm not sure if all PHP versions are effected..php 5.4 is though.

The modification is easy, the problem is that the very big locale array is initialized on every function call of them_locals() which is heavily used by our theme46551.

So what I did was modifying the wp-content/themes/CherryFramework/includes/locals.php file.. moved the Array $locals in a new function called theme_local_init(). I registered the variable in the global scope, like I did with a flag variable to check if this array is already initialized.

function theme_local_init()
{
    global $isThemeLocalInit, $locals_CherryFramework;
    if($isThemeLocalInit) return true;

    $domain = CURRENT_THEME;
    //... array initialization...
    $isThemeLocalInit = true;
}

function theme_locals($label) {
    global $locals_CherryFramework;
    theme_local_init();
    return $locals_CherryFramework[$label];
};

the speed up is incredible..memory footprint is much better, performance is about 4-5x faster.

regards,
Simon

@AriadnaA
Copy link
Contributor

Hi Simon,
Thank you for your help in development. You helped us a lot. We are willing to than you and offer a promo-code for a template from TemplateMonster.com. Please provide us with your email address to let us send you the promo-code.

regards,
Kate

@simllll
Copy link
Author

simllll commented Oct 29, 2013

You are welcome, thank you! You can find my email address at
http://www.stretter.at !

Thanks,
Simon

On 10/29/2013 03:40 PM, Kate Arapova wrote:

Hi Simon,
Thank you for your help in development. You helped us a lot. We are
willing to thank you and offer a promo-code for a template from
TemplateMonster.com. Please provide us with your email address to let
us send you the promo-code.

regards,
Kate


Reply to this email directly or view it on GitHub
#1 (comment).

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

2 participants