Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9448

Cache URLs, 20% performance increase

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.x
    • Fix Version/s: 3.1.0-b1
    • Component/s: Other
    • Labels:
      None

      Description

      An earlier round of profiling showed that viewtopic.php spends a lot of time calling append_sid() This function has been optimized which made quite a difference but a new profiling run shows that still a lot of time is spent in append_sid().

      Most of these calls are in a loop which results in several hundreds of append_sid() calls while only a single post/user ID is changed in these calls. I've replaced the calls to append_sid() with a simple str_replace which results in a 20% reduction in CPU time.

      Patch can be found here:

      http://www.typo.nl/misc/cache_viewtopic_urls.patch

      And has also been attached to this issue.

      Edit:
      A quick test by Paul shows that sprintf() is a bit faster than str_replace after all:
      [13:50:17] <paul|laptop> 1000x str_replace: 0.00122087001801 milliseconden
      [13:50:17] <paul|laptop> 1000x sprintf: 0.000857497215271 milliseconden

        Attachments

          Activity

            People

            Assignee:
            nickvergessen Joas Schilling [X] (Inactive)
            Reporter:
            BartVB BartVB [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: