Uploaded image for project: 'SonarPHP'
  1. SonarPHP
  2. SONARPHP-964

Fix performance issue on PHPTree.getLastToken()

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4
    • Component/s: Frontend
    • Labels:
      None

      Description

      PHPTree.getLastToken() iterates over all child trees to compute the result. This can lead to performance issues in some cases.

      For example, analyzing a file which contains a long array initializer with SonarQube Developer Edition (which generates UCFGs for all PHP files) takes around 2 minutes because we recompute the last token of the initializer for each array entry. Making PHPTree.getLastToken() return in constant time would eliminate any problem like that.

        Attachments

          Activity

            People

            Assignee:
            nils.werner Nils Werner
            Reporter:
            pierre-yves.nicolas Pierre-Yves Nicolas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: