0
Files
src/sql/sql_features.cc
Victor Costan 3ffd9a3731 sql: Add Finch trial for eliminating sql::Database::Preload().
The logic in sql::Database::Preload() is a pessimization for modern OS
schedulers, as it forces the kernel to read the first few pages of a
newly opened database. https://crbug.com/243949 suggests that this
method was added without performance testing, just like the more complex
SQLite patch that it replaces.

This CL sets up a Finch trial that will either prove that we can get rid
of the Preload() hack, or give us conclusive data about its usefulness.

Bug: 243949
Change-Id: Icfee9aaa3d125af207974536e8e5f5e64a9609ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1438031
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Chris Mumford <cmumford@google.com>
Commit-Queue: Steven Holte <holte@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662006}
2019-05-22 00:46:54 +00:00

26 lines
840 B
C++

// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sql/sql_features.h"
namespace sql {
namespace features {
// Skip the logic for preloading databases.
//
// Enabling this feature turns sql::Database::Preload() into a noop.
// https://crbug.com/243949 suggests that sql::Database::Preload() was added
// without any proper benchmarking, and the logic is a pessimization for modern
// OS schedulers.
//
// TODO(pwnall): After the performance impact of the change is assessed, remove
// sql::Database::Preload() and this flag.
const base::Feature kSqlSkipPreload{"SqlSkipPreload",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace features
} // namespace sql