Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't dynamically update the current working directory by default #11

Open
nex3 opened this issue Dec 1, 2015 · 0 comments
Open

Don't dynamically update the current working directory by default #11

nex3 opened this issue Dec 1, 2015 · 0 comments
Labels
type-enhancement A request for a change that isn't a bug
Milestone

Comments

@nex3
Copy link
Member

nex3 commented Dec 1, 2015

Currently in the default context, operations that need to know the current working directory (current, relative(), isWithin(), absolute(), and prettyUri()) have to check the working directory every time they run. This involves a call to Uri.base, which is reasonably expensive on the command-line VM and puts a severe limit on how much these functions can be optimized.

On the other hand, it's not clear how much value this behavior adds. It's rare for an application to switch its working directory, and if it does all its existing in-memory relative paths will become invalid anyway. When we decide to put out a breaking release, we should make the default context cache the first known value of current. We can then provide a dynamic context that has the current dynamic-updating behavior for users who need it.

@nex3 nex3 added the type-enhancement A request for a change that isn't a bug label Dec 1, 2015
@nex3 nex3 added this to the 2.0.0 milestone Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

1 participant