Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-181

Calendar render phase performance refactor

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.0.2
    • Component/s: Calendar (deprecated)
    • Labels:
      None

      Description

      The render phase of the Calendar needs a performance refactor, as it's currently not optimized.
      There are three specific methods, _renderWeekDays, _renderBlankDays, and _renderMonthDays which each create a single node, then clone and append a node inside of a while loop, sometimes setting the innerHTML of that node, and then to query for a CSS class to return a nodelist property.
      This leads to a lot of DOM operations that are unnecessary.

      Instead, I'm refactoring this to use string buffers, then doing a join on the string buffer. I'm creating a document fragment from that string, appending that document fragment in, and creating the nodelist from the childNodes of the document fragment.

      Overall, these methods went from about 985 method calls to about 150, and about it runs 80% faster.

        Attachments

          Activity

            People

            Assignee:
            nathan.cavanaugh Nate Cavanaugh
            Reporter:
            nathan.cavanaugh Nate Cavanaugh
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              11 years, 15 weeks, 5 days ago

                Packages

                Version Package
                1.0.2