2020-05-08 00:58:10 +01:00
|
|
|
[workspace]
|
|
|
|
|
2020-05-09 03:26:53 +01:00
|
|
|
# Here we declare that this is a workspace, containing several crates
|
|
|
|
# within it.
|
2021-06-24 16:44:54 +01:00
|
|
|
#
|
2022-04-23 12:51:44 +01:00
|
|
|
# Please keep this list topologically sorted by dependency relation, so
|
2021-06-24 16:44:54 +01:00
|
|
|
# that every crate appears _before_ any other crate that depends on it.
|
2020-05-08 00:58:10 +01:00
|
|
|
members = [
|
2022-06-08 17:15:55 +01:00
|
|
|
"crates/tor-basic-utils",
|
2021-08-27 14:53:09 +01:00
|
|
|
"crates/caret",
|
2022-04-13 16:32:23 +01:00
|
|
|
"crates/fs-mistrust",
|
2022-05-28 17:41:39 +01:00
|
|
|
"crates/safelog",
|
2022-06-08 17:15:55 +01:00
|
|
|
"crates/retry-error",
|
|
|
|
"crates/tor-error",
|
|
|
|
"crates/tor-config",
|
|
|
|
"crates/tor-events",
|
|
|
|
"crates/tor-units",
|
|
|
|
"crates/tor-rtcompat",
|
|
|
|
"crates/tor-rtmock",
|
|
|
|
"crates/tor-llcrypto",
|
|
|
|
"crates/tor-protover",
|
2021-08-27 14:53:09 +01:00
|
|
|
"crates/tor-bytes",
|
2022-06-08 17:15:55 +01:00
|
|
|
"crates/tor-socksproto",
|
|
|
|
"crates/tor-checkable",
|
2022-05-28 17:41:39 +01:00
|
|
|
"crates/tor-cert",
|
2022-06-08 17:15:55 +01:00
|
|
|
"crates/tor-linkspec",
|
|
|
|
"crates/tor-cell",
|
|
|
|
"crates/tor-proto",
|
|
|
|
"crates/tor-netdoc",
|
|
|
|
"crates/tor-consdiff",
|
|
|
|
"crates/tor-netdir",
|
|
|
|
"crates/tor-persist",
|
2021-08-27 14:53:09 +01:00
|
|
|
"crates/tor-chanmgr",
|
2022-06-08 17:15:55 +01:00
|
|
|
"crates/tor-guardmgr",
|
2021-08-27 14:53:09 +01:00
|
|
|
"crates/tor-circmgr",
|
|
|
|
"crates/tor-dirclient",
|
|
|
|
"crates/tor-dirmgr",
|
2022-06-08 17:15:55 +01:00
|
|
|
"crates/arti-client",
|
|
|
|
"crates/arti-config",
|
|
|
|
"crates/arti-hyper",
|
|
|
|
"crates/arti",
|
|
|
|
"crates/arti-bench",
|
|
|
|
"crates/arti-testing",
|
2021-08-27 14:53:09 +01:00
|
|
|
]
|
2021-05-05 14:19:25 +01:00
|
|
|
|
Tune the 'profile.release' options for a smaller compile size.
By enabling link-time optimization, setting 'opt-level=s', and
setting compilation-units=1, we can get a much smaller download
size, which is one of our objectives.
Making these changes reduces the binary size for me (on x86_64) by about
42%. If you also run "strip --strip-debug" on the resulting binary,
the resulting size is 55% smaller than the original binary size.
These effects persist if you compress the binary. Supposing that we
use xz compression, these options make save 32% of compressed binary
size. If we also "strip --strip-debug" before compressing, the compressed
binary saves 43% from the original binary size.
With all of these options applied, on x86_64 linux with xz
compression, we're at a nice 1.5 MiB download. If we statically link
to openssl and sqlite, we're still only at a 2.8 MiB download.
There is a build time cost to these changes: for me, it comes to
a 10%-25% build time increase.
This is part of arti#172.
2021-11-08 19:19:02 +00:00
|
|
|
resolver = "2"
|
|
|
|
|
|
|
|
[profile.release]
|
|
|
|
# By default we'd like to get good performance and a small download size.
|
|
|
|
# (Assuming xz compression on the binary.)
|
|
|
|
#
|
|
|
|
# The biggest win is to run `strip --strip-debug` on the binary after
|
2022-04-23 12:51:44 +01:00
|
|
|
# generating it, to throw out debugging symbols that we inherited from
|
Tune the 'profile.release' options for a smaller compile size.
By enabling link-time optimization, setting 'opt-level=s', and
setting compilation-units=1, we can get a much smaller download
size, which is one of our objectives.
Making these changes reduces the binary size for me (on x86_64) by about
42%. If you also run "strip --strip-debug" on the resulting binary,
the resulting size is 55% smaller than the original binary size.
These effects persist if you compress the binary. Supposing that we
use xz compression, these options make save 32% of compressed binary
size. If we also "strip --strip-debug" before compressing, the compressed
binary saves 43% from the original binary size.
With all of these options applied, on x86_64 linux with xz
compression, we're at a nice 1.5 MiB download. If we statically link
to openssl and sqlite, we're still only at a 2.8 MiB download.
There is a build time cost to these changes: for me, it comes to
a 10%-25% build time increase.
This is part of arti#172.
2021-11-08 19:19:02 +00:00
|
|
|
# other libraries. Don't do `strip --strip-unused`, though, or you'll
|
|
|
|
# break backtraces. That saves about 21% download size.
|
|
|
|
|
|
|
|
# Using LTO saves a further 14% of download size, and improves performance,
|
|
|
|
# at the cost of compile time.
|
|
|
|
lto = true
|
|
|
|
# Setting codegen-units=1 saves a further 7% download size. It also
|
|
|
|
# improves performance at the cost of compile time.
|
|
|
|
codegen-units = 1
|
|
|
|
# Optimize for size. [Actually this is even smaller than 'z' on rust
|
|
|
|
# 1.56. It saves about 11% download size over the default value of '3'.]
|
|
|
|
opt-level = 's'
|