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

SourceAccessor::readFile should be streaming in constant memory #11001

Open
roberth opened this issue Jul 1, 2024 · 0 comments
Open

SourceAccessor::readFile should be streaming in constant memory #11001

roberth opened this issue Jul 1, 2024 · 0 comments
Labels
fetching Networking with the outside (non-Nix) world performance

Comments

@roberth
Copy link
Member

roberth commented Jul 1, 2024

Describe the bug

This reads a whole file into memory.

void SourceAccessor::readFile(
    const CanonPath & path,
    Sink & sink,
    std::function<void(uint64_t)> sizeCallback)
{
    std::string s = readFile(path);
    sizeCallback(s.size());
    sink(s);
}

Steps To Reproduce

Expected behavior

Multiple sink(chunk) calls.

nix-env --version output

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added bug performance fetching Networking with the outside (non-Nix) world labels Jul 1, 2024
@edolstra edolstra removed the bug label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fetching Networking with the outside (non-Nix) world performance
Projects
None yet
Development

No branches or pull requests

2 participants