QmlJS: Improve parser performance

Detaching the rawString_stack alone shows up at 0.85% when loading
Creator inside Creator. One write access is actually used from
qmljs.g:699, so making the whole function const would need more work.

Take a short cut and replace the unneeded reference counted container
with a non-reference counted one.

Change-Id: I081bf5741899a01e4126b7ffe4f36e4844f0b19e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
hjk
2022-06-24 10:57:50 +02:00
parent e2bb204d4d
commit d45104f5db
2 changed files with 4 additions and 4 deletions

View File

@@ -446,8 +446,8 @@ protected:
Value *sym_stack = nullptr;
int *state_stack = nullptr;
SourceLocation *location_stack = nullptr;
QVector<QStringView> string_stack;
QVector<QStringView> rawString_stack;
std::vector<QStringView> string_stack;
std::vector<QStringView> rawString_stack;
AST::Node *program = nullptr;

View File

@@ -247,8 +247,8 @@ protected:
Value *sym_stack = nullptr;
int *state_stack = nullptr;
SourceLocation *location_stack = nullptr;
QVector<QStringView> string_stack;
QVector<QStringView> rawString_stack;
std::vector<QStringView> string_stack;
std::vector<QStringView> rawString_stack;
AST::Node *program = nullptr;