Skip to content

Commit

Permalink
Enable LTO for release builds (#1337)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem authored Dec 1, 2023
1 parent 8f3a697 commit 43c66a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ default-members = ["crates/symbolicator", "crates/symbolicli", "crates/symsorter
[profile.release]
# For release builds, we do want line-only debug information to be able to symbolicate panic stack traces.
debug = 1
codegen-units = 1
lto = true

[profile.local]
# For running a local symbolicator, we want the best of both worlds: a fast executable, with quick
Expand Down
3 changes: 2 additions & 1 deletion crates/symbolicator-service/src/caching/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl<T: CacheItemRequest> Cacher<T> {

if let Some(cache_dir) = self.config.cache_dir() {
// Cache is enabled, write it!
let mut cache_path = cache_dir.join(&cache_path);
let cache_path = cache_dir.join(&cache_path);

sentry::configure_scope(|scope| {
scope.set_extra(
Expand Down Expand Up @@ -258,6 +258,7 @@ impl<T: CacheItemRequest> Cacher<T> {

#[cfg(debug_assertions)]
{
let mut cache_path = cache_path;
// NOTE: we only create the metadata file once, but do not regularly touch it for now
cache_path.set_extension("txt");
if let Err(err) = std::fs::write(cache_path, key.metadata()) {
Expand Down

0 comments on commit 43c66a9

Please sign in to comment.