influxdb/Cargo.toml

152 lines
3.6 KiB
TOML
Raw Normal View History

[workspace]
# In alphabetical order
members = [
"arrow_util",
"backoff",
"cache_system",
"clap_blocks",
"client_util",
"compactor",
2022-05-05 19:29:24 +00:00
"data_types",
"datafusion_util",
"dml",
"executor",
"generated_types",
"grpc-binary-logger-proto",
"grpc-binary-logger-test-proto",
"grpc-binary-logger",
"import",
"influxdb_influxql_parser",
"influxdb_iox",
"influxdb_iox_client",
"influxdb_line_protocol",
"influxdb_storage_client",
"influxdb_tsm",
2021-11-19 19:02:08 +00:00
"influxdb2_client",
"influxrpc_parser",
"ingester",
"ingester2",
"iox_arrow_flight",
2022-01-11 17:51:56 +00:00
"iox_catalog",
"iox_data_generator",
"garbage_collector",
"iox_query",
"iox_tests",
"iox_time",
"ioxd_common",
"ioxd_compactor",
"ioxd_ingester",
2022-11-30 21:28:23 +00:00
"ioxd_ingester2",
"ioxd_garbage_collector",
"ioxd_querier",
"ioxd_router",
"ioxd_test",
"logfmt",
"metric",
"metric_exporters",
"mutable_batch",
"mutable_batch_lp",
"mutable_batch_pb",
"mutable_batch_tests",
"object_store_metrics",
"observability_deps",
"panic_logging",
2021-10-14 12:34:59 +00:00
"parquet_file",
"parquet_to_line_protocol",
"predicate",
"querier",
"query_functions",
"query_tests",
2022-05-06 18:51:52 +00:00
"router",
"schema",
"service_common",
"service_grpc_influxrpc",
"service_grpc_flight",
"service_grpc_namespace",
"service_grpc_object_store",
"service_grpc_catalog",
"service_grpc_schema",
"service_grpc_testing",
2022-06-09 19:10:16 +00:00
"sharder",
"sqlx-hotswap-pool",
"test_helpers",
"test_helpers_end_to_end",
"trace",
"trace_exporters",
"trace_http",
"tracker",
"trogging",
2022-11-17 19:35:02 +00:00
"wal",
"workspace-hack",
"write_buffer",
"write_summary",
]
default-members = ["influxdb_iox"]
resolver = "2"
exclude = [
"*.md",
"*.txt",
".circleci/",
".editorconfig",
".git*",
".github/",
".kodiak.toml",
"Dockerfile*",
"LICENSE*",
"buf.yaml",
"docker/",
"docs/",
"massif.out.*",
"perf/",
"scripts/",
2021-11-25 17:14:40 +00:00
"test_bench/",
"test_fixtures/",
"tools/",
]
[workspace.package]
version = "0.1.0"
authors = ["IOx Project Developers"]
edition = "2021"
license = "MIT OR Apache-2.0"
[workspace.dependencies]
arrow = { version = "29.0.0" }
arrow-flight = { version = "29.0.0" }
datafusion = { git = "https://github.com/apache/arrow-datafusion.git", rev="07f49803a3d7a9e9b3c2c9a7714c1bb08db71385", default-features = false }
datafusion-proto = { git = "https://github.com/apache/arrow-datafusion.git", rev="07f49803a3d7a9e9b3c2c9a7714c1bb08db71385" }
hashbrown = { version = "0.13.1" }
parquet = { version = "29.0.0" }
# This profile optimizes for runtime performance and small binary size at the expense of longer
# build times. It's most suitable for final release builds.
[profile.release]
codegen-units = 16
debug = true
chore: faster and smaller IOx binaries Use `codegen-units = 1`, thin-LTO and debug section compression to make our binary smaller (which is good for deploy and test times) and faster. # Summary The binary size of `influxdb_iox` after building with: ```console $ cargo build --release --no-default-features --features="aws,gcp,azure,jemalloc_replacing_malloc" ``` The profile was: ```toml [profile.release] debug = true ``` The commit was: ```text 89ece8b493c924d05ebfa75d6661be5462eaeefa ``` The size results are: | Method | Size | | ------------------------------------------ | ----- | | baseline | 833MB | | baseline + dbg compression | 222MB | | baseline + strip | 49MB | | codegen-units | 520MB | | codegen-units + strip | 40MB | | codegen-units + dbg compression | 143MB | | thin LTO | 715MB | | thin LTO + strip | 49MB | | thin LTO + dbg compression | 199MB | | codegen-units + thin LTO | 449MB | | codegen-units + thin LTO + strip | 40MB | | codegen-units + thin LTO + dbg compression | 130MB | For the methods that were successfully measured I couldn't really see any compile time differences on my laptop. # Methods ## Strip Remove debug symbols. We don't really want this, so this is just to get an idea of the size ```console $ strip baseline ``` ## Debug Sections compression Debug sections make a large amount of our binary size (a stripped executable is 49MB instead of 833MB). Since we like to have debug symbols we cannot just strip them. However these symbols are only used for: - backtrace generation (something went wrong, not BAU) - profiling - debugging So in normal operation and most test scenarios, we're just wasting memory. So we could compress them: ```console $ objcopy --compress-debug-sections baseline baseline-dbg_compressed ``` There is also elfutils: ```console $ eu-elfcompress test ``` Elfutils nearly ends up with the same size (220MB instead of 222MB that objcopy achieves), but takes more time and is probably not worth it. Note that compressed debug sections exist since many years. The Rust ecosystem supports reading them since over a year, see: - <https://github.com/gimli-rs/gimli/issues/195> - <https://github.com/rust-lang/backtrace-rs/issues/342> ## Codegen Units The rust compiler parallelizes codegen work. This split into units however means that optimizations are somewhat limited. This can be change by: ```toml [profile.release] ... codegen-units = 1 ``` As a nice side effect this should also make our code faster. ## Thin LTO Get LLVM to run "thin" Link Time Optimization: ```toml [profile.release] ... lto = "thin" ``` As a nice side effect this should also make our code faster. ## Fat LTO Get LLVM to run "fat" Link Time Optimization: ```toml [profile.release] ... lto = "fat" ``` There are no results for this because this took a massive amount of memory and CPU time and did not finish on my system.
2021-11-10 14:47:18 +00:00
lto = "thin"
2020-12-04 14:48:19 +00:00
[profile.bench]
debug = true
# This profile optimizes for short build times at the expense of larger binary size and slower
# runtime performance. It's most suitable for development iterations.
[profile.quick-release]
inherits = "release"
codegen-units = 16
lto = false
incremental = true
# Per insta docs: https://insta.rs/docs/quickstart/#optional-faster-runs
[profile.dev.package.insta]
opt-level = 3
[profile.dev.package.similar]
opt-level = 3
[patch.crates-io]
# remove and bump object_store dep version once this revision is released.
# patch for https://github.com/influxdata/idpe/issues/16611
object_store = { git = 'https://github.com/apache/arrow-rs.git', rev = "f5c165acc0e6cc4b34e0eaea006aab7e5bd28d66", package = "object_store" }