Skip to content

Commit

Permalink
Use heap indirection to manage type signatures
Browse files Browse the repository at this point in the history
The proxy's release debug symbols are currently >6GB. It doesn't appear
to even be possible to build the proxy with debuginfo=2, as we overflow
u32::MAX and violate the restrictions of DWARF32.

To fix this, we more aggressively use dynamic dispatch via the new
`Stack::arc_new_box` helpers. This helps reduce our largest type
signatures from >700KB to ~50KB. We'll want to follow up with changes
that monitor the size of these signatures to prevent regressions.

This allows us to minimize many type assertions, etc.

There are no functional changes in this PR. Release builds will now
produce full debug information with file:line annotations.
  • Loading branch information
olix0r committed Nov 10, 2023
1 parent 9d71c64 commit 1da8f8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ members = [
]

[profile.release]
debug = 1
debug = 2
lto = true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY . .
RUN --mount=type=cache,id=cargo,target=/usr/local/cargo/registry \
just fetch
ENV CARGO_INCREMENTAL=0
ENV RUSTFLAGS="-D warnings -A deprecated -C debuginfo=2"
ENV RUSTFLAGS="-D warnings -A deprecated"
ARG TARGETARCH="amd64"
ARG PROFILE="release"
ARG LINKERD2_PROXY_VERSION=""
Expand Down

0 comments on commit 1da8f8d

Please sign in to comment.