Issues

ZF-7672: Zend_Form_Element getTranslator function is MEGA slow (fix included)

Issue Type: Performance Improvement Created: 2009-08-24T05:47:34.000+0000 Last Updated: 2009-11-13T13:15:09.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: jaap vstr (jaapvstr) Assignee: Thomas Weidner (thomas) Tags: - Zend_Form

Related issues: Attachments:

Description

Zend_Form_Element getTranslator function would sometimes get me a page load time of 20seconds (1500 calls when calling onValidate). I finally found a way to improve performance by 18 seconds:

remove

<pre class="highlight">
and it's suddenly only 2 seconds total page load time.




public function getTranslator()
{
    if ($this->translatorIsDisabled()) {
        return null;
    }

    if (null === $this->_translator) {

// require_once 'Zend/Form.php'; <---- // FIXED LINE return Zend_Form::getDefaultTranslator(); } return $this->_translator; } ```

Ofcource it can be added on top of the class instead.

Comments

Posted by Thomas Weidner (thomas) on 2009-11-13T13:15:09.000+0000

Fixed with r18966

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts