rycus86 / githooks

Githooks: per-repo and global Git hooks with version control
MIT License
382 stars 20 forks source link

Speed? #41

Closed gabyx closed 5 years ago

gabyx commented 5 years ago

I realized, the speed of githooks is somewhat acceptable but not soo fast on Windows Git Bash... I was wondering, if that project would benefit from beeing ported to Go ;). Or do you have any other idea how to make it fast, or what was your experience?

I mean the lefthook project is good but lacks some awesome features in this repo. (Shared Hooks ...), Proper global install, safety on clone, internal LFS...)

rycus86 commented 5 years ago

Any particular parts you think are slow? I would think running the actual hooks is usually slower than the overhead Githooks adds, but happy to look at particular features if you have examples.

I love Go, but I think Posix Shell is just fine for a project like this as well, so not really looking at a rewrite - for now at least.

gabyx commented 5 years ago

Hm.. do you know how to profile bash scripts ? :-), really hard brain teaser? set -x helps but, At the end it would be good to have a notion about which function was the most time consuming :-) The project is enough simple to be really good understandable, which is plus. If it becomes Go, it gets more complicated I think :)...

rycus86 commented 5 years ago

Yeah, though it would also be more testable. But less run-the-same-everywhere crossplatform. So there's pros and cons.

What I wanted to point at is that if there are slow places in the code, I'm happy to look at them, and if the only way to make them faster is to rewrite them in Go for example, then I'll look at that. Otherwise I'm happy with the state of the code for now.

rycus86 commented 5 years ago

Closing this now but feel free to open a new issue if you find slow parts that need looking at!