Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-23754 Performance improvements META
  3. MDL-25637

count/sizeof calls are slow for big arrays. Reduce them whenever possible.

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Critical Critical
    • None
    • 2.0
    • Performance
    • MOODLE_20_STABLE
    • Moderate

      there are places where we can find:
      for($i = 1; $i < sizeof($data); $i++) {...

      these should really be
      $datasize = sizeof($data);
      for($i = 1; $i < $datasize; $i++) { ...

      this doesn't apply to places where the loop condition expression on both sides of the expression are dynamic.

            nebgor Aparup Banerjee
            nebgor Aparup Banerjee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.