Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29981

Turning formatstringstriptags off significantly harms site performance

    Details

    • Testing Instructions:
      Hide

      1. Create fresh moodle installation, time load for "My home"
      2. disable the setting formatstringstriptags.
      3. Reload "my home" - load time may be 2x longer.

      Show
      1. Create fresh moodle installation, time load for "My home" 2. disable the setting formatstringstriptags. 3. Reload "my home" - load time may be 2x longer.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE

      Description

      When disabling the option formatstringstriptags, site performance is significantly impaired, up to 2x or even worse.

      Profiling runs show a large amount of time (multiple seconds) can be spent inside the navigation block cleaning up text using purify_html.
      This becomes especially bad on sites with many navigation nodes.

      Something needs to be done to avoid doing format_string=>clean_text=>purify_html, or a significant reduction in purify_html run times.

      One suggestion is to disallow HTML in navigation nodes, i.e act as if formatstringstriptags is always on for navigation items - this can be done by always doing strip_tags and skipping clean_text in this case. See the linked patch for one attempt at this.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: