Skip to content

opam update completely reloads the repository #5824

Closed

Description

@dra27

This is most noticeable on Windows, where the file system I/O between opam / OCaml is effectively slower, but the problem can be seen in less-cached environments - e.g. in a Docker container on Linux.

For a git remote, opam is able to short-circuit reloading the entire repository when it detects that there are no changes (this is a good reason for using git remotes, as it's a faster check than for the https remote). However, if there are any changes, the entire repository is reloaded.

It seems we could be fairly easily doing something a little better, and possibly also for the https remote on update. The update is actually applied by means of a patch (even for git remotes), which means that opam always knows exactly which files have changed.

Related to @kit-ty-kate's work on #5741 (and also #5648).

Activity

  1. kit-ty-kate commented on Apr 2, 2024

    @kit-ty-kate
    Member

    Could be done using the diff implementation in #5892

  2. kit-ty-kate commented on May 7, 2024

    @kit-ty-kate
    Member

    I had a look at this again and it would require #5892 (and also use this diff implementations for VCSs) or someone needs to go on a deep dive and find a way to fix hannesm/patch#17 that matches every implementations of diff

  3. added this to the 2.5.0~alpha1 milestone on Jul 9, 2025
  4. self-assigned this
    on Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions