bkeepers / dotenv

A Ruby gem to load environment variables from `.env`.
MIT License
6.6k stars 506 forks source link

Huge loading time at Macbook Pro M1 Ventura 13.6 #513

Closed kortirso closed 2 weeks ago

kortirso commented 3 weeks ago

Steps to reproduce

I have problem with loading time for work application, found issue and reproduced on simple new app If new rails app does use dotenv-rails - it starts fast

if app has gem "dotenv-rails", "~> 3.1.4", require: "dotenv/load" and .env.local file contains 50 variables - loading time is ~ 10 seconds if .env.local file contains 100 variables - loading time is ~ 20 seconds

env variables looks like SENDGRID__DOMAIN1=localhost1

I cloned dotenv locally and run tests Finished in 27.07 seconds (another developer with intel macbook has Finished in 1.44 seconds) then added some variables to fixtures Finished in 57.7 seconds

I don't know what I can try to do more to debug this case

Expected behavior

Quick app starting

Actual behavior

Very slow app starting

System configuration

dotenv version: 3.1.4

Rails version: 7.0.6 (tested with 7.2.2 too)

Ruby version: 3.2.2 (tested with 3.2.0, 2.7.7 too)

bkeepers commented 2 weeks ago

Hey @kortirso, did you figure out what was going on?

kortirso commented 2 weeks ago

hi, @bkeepers , yes, it was something wrong with installed brew packages, some conflict, I don't know exactly which one

I removed all packages and installed again only required, and problem gone