refact: optimize regular expression initialization

add profiling test.

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-08-21 18:38:27 +08:00
committed by Comix
parent 06ee5e5899
commit 2bdb9e99ee
6 changed files with 50 additions and 7 deletions

20
tools/profiling.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/env bash
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
cd "$(git rev-parse --show-toplevel)" || exit 255
BUILD_DIR=${BUILD_DIR:="build-prof"}
cmake -B "$BUILD_DIR" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DDEBUG_MODE=OFF \
-DPROFILING_MODE=ON
cmake --build "$BUILD_DIR" -j$(nproc)
QT_LOGGING_RULES="*.debug=false;*.info=false;*.warning=false" valgrind --tool=cachegrind --cachegrind-out-file="$BUILD_DIR/profiling.out" "$BUILD_DIR/apps/dde-application-manager/src/dde-application-manager"
echo "you can use Kcachegrind to check this profiling result."

View File

@ -21,4 +21,4 @@ cmake --build "$BUILD_DIR" -j$(nproc)
cmake --build "$BUILD_DIR" -j$(nproc) -t test
gcovr -f "src/*" --html-details "$BUILD_DIR"/coverage.html
gcovr -f "src/*" --html-details "$HTML_DIR"/coverage.html