Coder Social home page Coder Social logo

Comments (4)

purcell avatar purcell commented on June 5, 2024 1

Yeah, it depends a bit on the environment direnv is passed. In envrc, I always run direnv in a default (non-direnv-produced) environment, so it will always re-calculate the new env, which can be costly (well, usually more than a few milliseconds). What happens with direnv.el is that you are mostly passing the direnv-augmented environment to direnv, and when that environment contains DIRENV_MTIME, DIRENV_WATCHES etc., direnv uses that to quickly yield a cached result where possible. I'll probably move to calling direnv more frequently, anbd relying on its caching, but to do that I'll have to change how envrc invokes DIRENV, and effectively pass it the last-known env for a given direnv.

from emacs-direnv.

wbolster avatar wbolster commented on June 5, 2024

cc @purcell

from emacs-direnv.

purcell avatar purcell commented on June 5, 2024

Yeah, this makes sense to me: it would at least make the updates predictable.

from emacs-direnv.

wbolster avatar wbolster commented on June 5, 2024

i did some experimentation here.

direnv itself avoids running envrc already even if directories change (instead of blindly running and producing an empty diff), so it seems useless to try to be smart about that inside emacs, since direnv itself is already smart enough, and running direnv itself takes just a few milliseconds in those cases, which is fine to do once per buffer-switch.

(furthermore, using locate-dominating-file adds i/o to the mix since it has to stat() for potential .envrc files up the directory tree, and when direnv is executed it would just do the same again.)

from emacs-direnv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.