sqlite_chromium_configuration_flags.gni 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Compile-time options passed to SQLite when compiling and building
  2. # the Chromium amalgamation.
  3. #
  4. # The vast majority of the macros here are documented at
  5. # https://www.sqlite.org/compile.html
  6. #
  7. # This file is read by a GN build script as well as generate_amalgamation.py
  8. #
  9. # By default, we disable all SQLite features that can be disabled by adding a
  10. # SQLITE_OMIT_ define, or by leaving out a SQLITE_ENABLE_ define. We only enable
  11. # features that have compelling use cases in the codebase.
  12. #
  13. # Each SQLite feature carries a cost to our users (binary size, pressure on
  14. # caches and branch predictors, extra surface area for security
  15. # vulnerabilities), as well as a maintenance cost (more surface area to be
  16. # covered by our fuzzers, more logic to reason through when debugging a crash
  17. # or a security vulnerability report). Enabled features must provide benefits
  18. # that outweigh these costs.
  19. sqlite_chromium_configuration_flags = [
  20. # Chrome doesn't use the ANALYZE SQLite extension.
  21. #
  22. # ANALYZE [1] is non-standard, and currently performs a table scan to
  23. # update statistics used by the query planner. Chrome uses straightforward
  24. # database schemas which do not require the level of fine tuning provided
  25. # by ANALYZE, and we generally cannot afford the I/O cost of the required
  26. # table scans.
  27. #
  28. # [1] https://www.sqlite.org/lang_analyze.html
  29. "SQLITE_OMIT_ANALYZE",
  30. # Chrome initializes SQLite manually in //sql/connection.cc.
  31. "SQLITE_OMIT_AUTOINIT",
  32. # Chrome should not use queries with the pathologic performance cases
  33. # mitigated by automatic indexes.
  34. #
  35. # Disabling automatic indexing exposes the pathological performance problems,
  36. # instead of having SQLite paper over them. This helps us catch the prbolems
  37. # in early testing, such as pinpoint and Finch.
  38. #
  39. # As a bonus, disabling automatic indexing simplifies the mental model for
  40. # SQLite's optimizer, which makes a bit it easier to reason about SQL
  41. # statement performance.
  42. #
  43. # See https://www.sqlite.org/optoverview.html#autoindex
  44. "SQLITE_OMIT_AUTOMATIC_INDEX",
  45. # Chrome calls sqlite3_reset() correctly to reset prepared statements.
  46. "SQLITE_OMIT_AUTORESET",
  47. # Chromium does not use sqlite3_{get,free}_table().
  48. # Chrome doesn't use sqlite3_compileoption_{used,get}().
  49. "SQLITE_OMIT_COMPILEOPTION_DIAGS",
  50. # Chrome doesn't ship the SQLite shell, so command auto-completion is not
  51. # needed. Chrome developers who build the SQLite shell living at
  52. # //third_party/sqlite:sqlite_shell for diagnostic purposes will have to
  53. # live without auto-completion.
  54. "SQLITE_OMIT_COMPLETE",
  55. # EXPLAIN's output is not stable across releases [1], so it should not be
  56. # used in Chrome. Skipping the EXPLAIN machinery also results in
  57. # non-trivial binary savings.
  58. #
  59. # [1] https://www.sqlite.org/lang_explain.html
  60. "SQLITE_OMIT_EXPLAIN",
  61. # Chrome does not use sqlite3_{get,free}_table().
  62. "SQLITE_OMIT_GET_TABLE",
  63. # Chrome does not use PRAGMA {function,module,pragma}_list.
  64. "SQLITE_OMIT_INTROSPECTION_PRAGMAS",
  65. # Chrome already depends on malloc being very efficient, so we disable
  66. # SQLite's arena allocator.
  67. "SQLITE_DEFAULT_LOOKASIDE=0,0",
  68. "SQLITE_OMIT_LOOKASIDE",
  69. # Chrome doesn't use TCL variables.
  70. "SQLITE_OMIT_TCL_VARIABLE",
  71. # The REINDEX statemnt is only useful if a collation sequence's definition
  72. # changes [1]. Chrome never defines its own collation sequences [2, 3], so
  73. # it never needs to call REINDEX.
  74. #
  75. # [1] https://www.sqlite.org/lang_reindex.html
  76. # [2] https://www.sqlite.org/datatype3.html#collating_sequences
  77. # [3] https://www.sqlite.org/c3ref/create_collation.html
  78. "SQLITE_OMIT_REINDEX",
  79. # Chrome doesn't use sqlite3_{profile,trace}().
  80. "SQLITE_OMIT_TRACE",
  81. # Chrome doesn't use UPSERT.
  82. "SQLITE_OMIT_UPSERT",
  83. # Chrome doesn't use window functions in SQL.
  84. "SQLITE_OMIT_WINDOWFUNC",
  85. ]