From bb918250c5becb8f35a5e3e9fc196d3d016a294f Mon Sep 17 00:00:00 2001 From: MartinChoo <214582617@qq.com> Date: Thu, 27 Feb 2025 17:22:37 +0800 Subject: [PATCH] Optimize page hash check for improve perf Signed-off-by: MartinChoo <214582617@qq.com> --- BUILD.gn | 5 ++++- bundle.json | 2 +- sqlite.gni | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 sqlite.gni diff --git a/BUILD.gn b/BUILD.gn index 030d401..3b03c37 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//build/ohos.gni") +import("//third_party/sqlite/sqlite.gni") is_cross_platform_build = defined(is_arkui_x) && is_arkui_x sqlite_patched_dir = root_out_dir + "/patched_sqlite" @@ -121,8 +122,10 @@ ohos_shared_library("sqlite") { "SQLITE_HDR_CHECK", "SQLITE_ENABLE_ICU", "SQLITE_META_DWR", - "SQLITE_CHECK_PAGES", ] + if (sqlite_support_check_pages) { + defines += [ "SQLITE_CHECK_PAGES" ] + } cflags_c = [ "-fvisibility=hidden", "-Wno-implicit-fallthrough", diff --git a/bundle.json b/bundle.json index 2d7932d..b733d95 100644 --- a/bundle.json +++ b/bundle.json @@ -14,7 +14,7 @@ "name": "sqlite", "subsystem": "thirdparty", "syscap": [], - "features": [], + "features": [ "sqlite_support_check_pages" ], "adapted_system_type": [ "standard" ], "rom": "2200KB", "ram": "1024KB", diff --git a/sqlite.gni b/sqlite.gni new file mode 100644 index 0000000..0f9c791 --- /dev/null +++ b/sqlite.gni @@ -0,0 +1,16 @@ +# Copyright (C) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare_args() { + sqlite_support_check_pages = false +} -- Gitee