Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-137220

Refactor classify* functions called from Lexer::classify

    XMLWordPrintable

Details

    Description

      It looks somewhat ugly

      Unfortunately to refactor it properly some proper benchmarks are needed in the first place.

      For the inspo on quick & dirty benchmark see https://codereview.qt-project.org/c/qt/qtdeclarative/+/648479/2
      However in practice it would be super helpful, first to research and analyse average or most common usecases, a.k.a. average length of words, overlap with keywords, qml / js modes etc.

      Then based on these to prepare / select a good representative sample of the benchmarking data and not just random files.

      Afterwards some of the refactroing / optimizations are possible. Probably some form of a trie will make sense there, however other approaches could be explored.

      Previous attempt of some refactoring (https://codereview.qt-project.org/c/qt/qtdeclarative/+/646911/7) with quick and dirty benchmark mentioned above, resulted in more or less expected performance drop. (left side is pre refactoring, right side is after )

      Further analysis / correctness etc. are needed

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtqmlteam Qt Qml Team User
            dima.a Dmitrii Akshintsev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes