Skip to content

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

Open
@nex3

Description

@nex3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions