You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #1669 - jtgeibel:remove-duplicate-dotenv-inits, r=sgrif
Remove duplicate initialization of `dotenv`
While doing memory profiling, I noticed that `dotenv` was being
initialized each time the `env` helper function was called. With my
`.env` file in development it was (temporarily) allocating 9.7MB on
each call to the `env` helper.
The `dotenv::var` helper uses `std::sync::Once` and avoids this
duplicate work. I don't expect this to improve allocation patterns on
production much/any, as without a `.env` file, only 1.9kB is
(temporarily) allocated.
Some binaries will initialize sooner and will pick up some variables that
would not previously work from `.env`.
0 commit comments