# Startup time for default environment slow

**URL:** <https://discourse.flox.dev/t/startup-time-for-default-environment-slow/1078>\
**Category:** Developing with flox\
**Created:** [February 11, 2025, 4:42pm UTC](https://discourse.flox.dev/t/startup-time-for-default-environment-slow/1078 "2025-02-11T16:42:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kendallm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/kendallm/32/722_2.png) [@kendallm](https://discourse.flox.dev/u/kendallm)\
**Post date:** [February 11, 2025, 4:42pm UTC](https://discourse.flox.dev/t/startup-time-for-default-environment-slow/1078/1 "2025-02-11T16:42:02Z")

</div>

I’ve been using flox significantly and have been trying to replace homebrew with flox. I have a default environment with all of the tools I use, but activating my default environment with every new window is pretty slow (3-5 seconds). This happens for each new terminal window I open, which is pretty frequent for me.

Is there anyway to speed this up when using the default environment?

```auto
~ on ☁️ (us-west-1) on ☁️ endallk007@gmail.com
❯ time zsh -i -c exit
ℹ️ Upgrades are available for packages in 'kendallm/default'.
Use 'flox upgrade' to get the latest.

zsh -i -c exit 0.98s user 1.23s system 90% cpu 2.444 total

```

I profiled just the activate command with zprof to see what was going on with flox and there seems to be a lot of work happening. Ideally I would replace homebrew with flox for my main dev setup, but the startup time is a bit rough for me.

```zsh
zmodload zsh/zprof
eval "$(flox activate -m run -d $HOME)"
zprof

```

```auto
num calls time self name
-----------------------------------------------------------------------------------
 1) 1 153.09 153.09 43.52% 153.09 153.09 43.52% compdump
 2) 1 351.70 351.70 99.99% 79.38 79.38 22.57% compinit
 3) 957 74.09 0.08 21.06% 74.09 0.08 21.06% compdef
 4) 2 45.14 22.57 12.83% 45.14 22.57 12.83% compaudit
 5) 1 0.05 0.05 0.01% 0.05 0.05 0.01% add-zsh-hook

-----------------------------------------------------------------------------------

 2) 1 351.70 351.70 99.99% 79.38 79.38 22.57% compinit
       1/2 45.14 45.14 12.83% 0.16 0.16 compaudit [4]
     957/957 74.09 0.08 21.06% 74.09 0.08 compdef [3]
       1/1 153.09 153.09 43.52% 153.09 153.09 compdump [1]

-----------------------------------------------------------------------------------

       1/1 153.09 153.09 43.52% 153.09 153.09 compinit [2]
 1) 1 153.09 153.09 43.52% 153.09 153.09 43.52% compdump

-----------------------------------------------------------------------------------

     957/957 74.09 0.08 21.06% 74.09 0.08 compinit [2]
 3) 957 74.09 0.08 21.06% 74.09 0.08 21.06% compdef

-----------------------------------------------------------------------------------

       1/2 45.14 45.14 12.83% 0.16 0.16 compinit [2]
       1/2 44.98 44.98 12.79% 44.98 44.98 compaudit [4]
 4) 2 45.14 22.57 12.83% 45.14 22.57 12.83% compaudit
       1/2 44.98 44.98 12.79% 44.98 44.98 compaudit [4]

-----------------------------------------------------------------------------------

 5) 1 0.05 0.05 0.01% 0.05 0.05 0.01% add-zsh-hook

```

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [February 11, 2025, 5:00pm UTC](https://discourse.flox.dev/t/startup-time-for-default-environment-slow/1078/2 "2025-02-11T17:00:50Z")

</div>

We’ve actually made a few improvements that should land in the next release. If you want to test those out, you can grab an installer for the latest commit on main from [https://shipit.flox.dev/](https://shipit.flox.dev/)

As a temporary workaround, it looks like you’ve pulled an environment from FloxHub. If you detach it from FloxHub with `flox pull --copy` that should be a little faster.

Does it feel usable after either of those, or still no? There are still some other things that we’d like to speed up

---

<div class="post-metadata">

**Author:** ![kendallm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/kendallm/32/722_2.png) [@kendallm](https://discourse.flox.dev/u/kendallm)\
**Post date:** [February 14, 2025, 4:15pm UTC](https://discourse.flox.dev/t/startup-time-for-default-environment-slow/1078/3 "2025-02-14T16:15:44Z")

</div>

Detaching from FloxHub helps significantly! With detaching from FloxHub, is there a better way to keep changes in sync other than force pushing?

---

<div class="post-metadata">

**Author:** ![ysndr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ysndr/32/340_2.png) [@ysndr](https://discourse.flox.dev/u/ysndr)\
**Post date:** [February 19, 2025, 11:31am UTC](https://discourse.flox.dev/t/startup-time-for-default-environment-slow/1078/4 "2025-02-19T11:31:16Z")

</div>

The performance fixes are out now with [Flox v1.3.13](https://discourse.flox.dev/t/flox-v1-3-13-available/1088). This should apply to environments irrespective of whether they are attached to floxhub or not.
