# Reduce LLVM IR bloat in closure funnels \(\#63426\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/399258feeaf90ad8a3a208c99221ee87b6452f38)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 399258feeaf90ad8a3a208c99221ee87b6452f38

Requested commit: 399258feeaf90ad8a3a208c99221ee87b6452f38

Commit: 399258feeaf90ad8a3a208c99221ee87b6452f38

Tree: b91e7efd61acf63baca13dedbe13a9c81386974f

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Reduce LLVM IR bloat in closure funnels (#63426)

Follow-up to https://github.com/zed-industries/zed/pull/63232

Cuts closure monomorphization in settings and editor: settings file
updates now share one boxed write-pipeline instantiation instead of
inlining the `SettingsContent` clone, both `serde_json::to_value` calls,
and the JSON diff at every call site; `Editor::register_action` and the
settings enum dropdown get the same treatment. Behavior and public
signatures are unchanged; thin generic shims remain.

Symbol table of the release binary:
Before: `update_settings_file_inner` 229 instantiations, inlined
`serde_json` `SerializeMap` machinery 6547 copies
After: 3 instantiations, 673 copies (-89.7%); `render_dropdown` is no
longer instantiated at all

With sccache disabled, `cargo clean` and `cargo build --release -p zed`:
Before: zed binary 420677880 bytes
After: zed binary 396999464 bytes (-5.6%, -23.7MB)

Release Notes:

- N/A
```

## Parents

- [19e458b78ae0dacdbb91bc528681c5f13eee0cd3](https://git.cafe/gitcafe/zed/commit/19e458b78ae0dacdbb91bc528681c5f13eee0cd3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/399258feeaf90ad8a3a208c99221ee87b6452f38?format=markdown)
