Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-7922

append_sid() performance improvement

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.4
    • 3.0.x
    • Sessions
    • None
    • PHP Environment:
      Database:

      append_sid() was another function that really stood out when running phpBB profile data through Kcachegrind. On a viewtopic.php page it uses approx 20% of the page time. I've been able to reduce this to 10% by introducing this code at the top of the function:

              // Handle really simple cases quickly
              if ($_SID == '' && $session_id === false && empty($_EXTRA_URL) && !is_array($params))
              {
                      return $url . ($params !== false ? '?'. $params : '');
              }

      This covers the majority of calls to append_sid(). Call time can be further reduced to approx 6% by caching (static var) if there is a relevant hook available.

            Acyd Burn Meik Sievertsen [X] (Inactive)
            BartVB BartVB [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: