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

Inefficient file checks #557

Open
baryluk opened this issue Dec 18, 2023 · 0 comments
Open

Inefficient file checks #557

baryluk opened this issue Dec 18, 2023 · 0 comments

Comments

@baryluk
Copy link

baryluk commented Dec 18, 2023

[pid 3862670] lstat("../.dub/packages/mir-algorithm/3.21.0/mir-algorithm/source/mir/bignum/fp.d", {st_mode=S_IFREG|0644, st_size=22391, ...}) = 0
[pid 3862670] lstat("../.dub/packages/mir-algorithm/3.21.0/mir-algorithm/source/mir/bignum/fp.d", {st_mode=S_IFREG|0644, st_size=22391, ...}) = 0
[pid 3862670] lstat("../.dub/packages/mir-algorithm/3.21.0/mir-algorithm/source/mir/bignum/fp.d", {st_mode=S_IFREG|0644, st_size=22391, ...}) = 0
[pid 3862670] stat("../.dub/packages/mir-algorithm/3.21.0/mir-algorithm/source/mir/bignum/fp.d", {st_mode=S_IFREG|0644, st_size=22391, ...}) = 0

This gets pretty inefficient, multiplied by number of files it is checking.

DUB version 1.35.0, built on Dec  2 2023

Linux, amd64

Input:

v2.d:

#!/usr/bin/env -S dub
/+dub.sdl:
dependency "mir-algorithm" version="~>3.6"
+/
import mir.algorithm.iteration: each;
import mir.ndslice;
import std.stdio: writeln;

void main()
{
    auto matrix = slice!double(3, 4);
    matrix[] = 0;
    matrix.diagonal[] = 1;

    auto row = matrix[2];
    row[3] = 6;
    // D & C index order
    assert(matrix[2, 3] == 6);

    matrix.byDim!0.each!writeln;
}

Run:

$ strace -f ./v2.d
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant