Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
None
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