Skip to content

Conversation

@MrSubidubi
Copy link
Member

@MrSubidubi MrSubidubi commented Oct 11, 2025

This PR primarily does two things:

  • replace serde_json::from_reader with serde_json::from_slice, as the latter is much much faster, even with loading the file into memory first.
  • runs the initial loading of themes and icon themes coming from extensions in parallel instead of sequential.

Measuring the eager_load_active_theme_and_icon_theme method, this drastically improves the speed at which this happens (tested this method primarily with debug builds on my MacBook Pro, but the Before measurement was also confirmed against a release-fast build):

  • Before: ~260ms on average (in one run, it even took 600ms)
  • After: ~20ms on average

Which reduces the time this method takes to load these by around ~92%.

Given that we block on this during the initial app startup, this should drastically improve Zeds initial startup loading time. Yet, it also improves responsiveness when installing theme extensions and trying these.

I also replaced all other serde_json::from_reader implementations with serde_json::from_slice and added the former to disallowed_methods, given serde-rs/json#160 (comment).

Release Notes:

  • Improved Zed startup speed when using themes provided by extensions
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 11, 2025
@zed-industries-bot

This comment was marked as off-topic.

@MrSubidubi MrSubidubi merged commit 81cd435 into main Oct 13, 2025
24 checks passed
@MrSubidubi MrSubidubi deleted the faster-startup branch October 13, 2025 09:53
P1n3appl3 pushed a commit to P1n3appl3/zed that referenced this pull request Oct 18, 2025
This PR primarily does two things:
- replace `serde_json::from_reader` with `serde_json::from_slice`, as
the latter is much much faster, even with loading the file into memory
first.
- runs the initial loading of themes and icon themes coming from
extensions in parallel instead of sequential.

Measuring the `eager_load_active_theme_and_icon_theme` method, this
drastically improves the speed at which this happens (tested this method
primarily with debug builds on my MacBook Pro, but the `Before`
measurement was also confirmed against a `release-fast` build):
- Before: ~260ms on average (in one run, it even took 600ms)
- After: ~20ms on average

Which reduces the time this method takes to load these by around ~92%.

Given that we block on this during the initial app startup, this should
drastically improve Zeds initial startup loading time. Yet, it also
improves responsiveness when installing theme extensions and trying
these.

I also replaced all other `serde_json::from_reader` implementations with
`serde_json::from_slice` and added the former to `disallowed_methods`,
given
serde-rs/json#160 (comment).

Release Notes:

- Improved Zed startup speed when using themes provided by extensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

3 participants