From d45104f5db3e8bacb3b5a443dcf304467a31c0cc Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 24 Jun 2022 10:57:50 +0200 Subject: [PATCH] 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: Reviewed-by: Fawzi Mohamed --- src/libs/qmljs/parser/qmljs.g | 4 ++-- src/libs/qmljs/parser/qmljsparser_p.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/qmljs/parser/qmljs.g b/src/libs/qmljs/parser/qmljs.g index 5f62edf4d16..1c81e265fd4 100644 --- a/src/libs/qmljs/parser/qmljs.g +++ b/src/libs/qmljs/parser/qmljs.g @@ -446,8 +446,8 @@ protected: Value *sym_stack = nullptr; int *state_stack = nullptr; SourceLocation *location_stack = nullptr; - QVector string_stack; - QVector rawString_stack; + std::vector string_stack; + std::vector rawString_stack; AST::Node *program = nullptr; diff --git a/src/libs/qmljs/parser/qmljsparser_p.h b/src/libs/qmljs/parser/qmljsparser_p.h index d19b4ebb885..3a571e983cd 100644 --- a/src/libs/qmljs/parser/qmljsparser_p.h +++ b/src/libs/qmljs/parser/qmljsparser_p.h @@ -247,8 +247,8 @@ protected: Value *sym_stack = nullptr; int *state_stack = nullptr; SourceLocation *location_stack = nullptr; - QVector string_stack; - QVector rawString_stack; + std::vector string_stack; + std::vector rawString_stack; AST::Node *program = nullptr;