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

Use walker #195

Merged
merged 12 commits into from
Nov 4, 2019
Merged

Use walker #195

merged 12 commits into from
Nov 4, 2019

Conversation

mattn
Copy link
Contributor

@mattn mattn commented Oct 25, 2019

filepath.Walk is bits slow since it call os.Stat for each files. This pull-request use github.com/saracen/walker instead.

$ ghq list | wc -l
2838

Before

real    3.537
system  2.652
user    0.608

After

real    1.054
system  2.043
user    0.374

@mattn
Copy link
Contributor Author

mattn commented Oct 25, 2019

Hmm, I changed behavior for permission error while walking directories. saracen/walker stop walking when non-permitted directory found. If you are okay, please merge this.

@Songmu
Copy link
Member

Songmu commented Oct 26, 2019

Hmm, unfortunately when this is merged, the issue #173 will recur.

I also want to solve the issue #187, so I can't merge this.

@mattn
Copy link
Contributor Author

mattn commented Oct 27, 2019

How about copying codes of fastwalk ?

@Songmu
Copy link
Member

Songmu commented Oct 28, 2019

That's a good idea, but before that, we should make a suggestion to saracen/walker that it can do handle unpermitted files.

Also, even if we'll use fastwalk, it's not a good idea to have source code in this repository, but it is better you fork it and utilize it in it.

@mattn
Copy link
Contributor Author

mattn commented Oct 30, 2019

Before

real    0m0.058s
user    0m0.012s
sys     0m0.054s

After

real    0m0.019s
user    0m0.014s
sys     0m0.000s

@Songmu Songmu merged commit d23edce into x-motemen:master Nov 4, 2019
Songmu added a commit that referenced this pull request Nov 4, 2019
## [v0.12.7](v0.12.6...v0.12.7) (2019-11-05)

* fix accepted values of ghq.<url>.vcs in README [#196](#196) ([autopp](https://github.com/autopp))
* Use walker [#195](#195) ([mattn](https://github.com/mattn))
* Use filepath [#194](#194) ([mattn](https://github.com/mattn))
* go.{mod,sum}: Update xerrors dependency [#193](#193) ([rvolosatovs](https://github.com/rvolosatovs))
* define func detectUserName and utilize it [#191](#191) ([Songmu](https://github.com/Songmu))
@mattn mattn deleted the use-walker branch November 4, 2019 23:50
@Songmu Songmu mentioned this pull request Nov 5, 2019
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

Successfully merging this pull request may close these issues.

2 participants