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

Could improve performance of get_string ~5% with small change

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.0
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      I am not sure if anyone cares at all, but there is a trivial change (checking array keys instead of array values, using static array) which can make get_string approx 5% faster for free.

      On our developer server this makes the difference between being able to do about 17,000 get_string calls per second, and about 18,000 calls per second, so it's not exactly like it was slow before.

      (I am not going to check this in unless somebody asks me to. I mostly did it in case there are performance concerns with MDL-12433.)

        Gliffy Diagrams

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10