-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
ipfs pin ls <not-pinned-hash> takes very long and uses lots of CPU #3783
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
Comments
I'll dig this up |
If you have 5s there, you can capture CPU profile and it will give you some data. |
@hsanjuan its probably enumerating the entire pinset and making sure that the hash youre giving it isnt anywhere in any of the indirect pins |
@whyrusleeping |
@hsanjuan If youre listing on a recursive or direct pin, it will see that its in the immediate pinset and short circuit. When its not in the top level set, it has to check whether or not its referenced indirectly. You might try just checking if your pin is |
The problem is that when checking if a single pin exists, the code takes every recursive pin and does a This means that branches will be recursively explored over and over even when they are shared by different parents. On the other side I think it would make sense have the same approach as |
This avoids revisiting already-searched branches and cut down the IsPinned() check times considerably when recursive pins share big underlying DAGs. License: MIT Signed-off-by: Hector Sanjuan <[email protected]>
This avoids revisiting already-searched branches and cut down the IsPinned() check times considerably when recursive pins share big underlying DAGs. A test has been added which double-checks that pinned and unpinned items lookups respond as expected with shared branches. License: MIT Signed-off-by: Hector Sanjuan <[email protected]>
This avoids revisiting already-searched branches and cut down the IsPinned() check times considerably when recursive pins share big underlying DAGs. A test has been added which double-checks that pinned and unpinned items lookups respond as expected with shared branches. License: MIT Signed-off-by: Hector Sanjuan <[email protected]>
This avoids revisiting already-searched branches and cut down the IsPinned() check times considerably when recursive pins share big underlying DAGs. A test has been added which double-checks that pinned and unpinned items lookups respond as expected with shared branches. License: MIT Signed-off-by: Hector Sanjuan <[email protected]>
This avoids revisiting already-searched branches and cut down the IsPinned() check times considerably when recursive pins share big underlying DAGs. A test has been added which double-checks that pinned and unpinned items lookups respond as expected with shared branches. License: MIT Signed-off-by: Hector Sanjuan <[email protected]>
This avoids revisiting already-searched branches and cut down the IsPinned() check times considerably when recursive pins share big underlying DAGs. A test has been added which double-checks that pinned and unpinned items lookups respond as expected with shared branches. License: MIT Signed-off-by: Hector Sanjuan <[email protected]>
Fix #3783: Improve IsPinned() lookups for indirect pins
Version information: 0.4.7-rc1
Type: Bug
Priority: P3
Description:
While
ipfs pin ls <pinned hash>
works fast.ipfs pin ls <unpinned hash>
takes forever to inform the user that the hash is not pinned. I also observe around 5 secs 200% CPU usage until the request comes back. Tested with 0.4.5 and happens at least since then.The text was updated successfully, but these errors were encountered: