talisman icon indicating copy to clipboard operation
talisman copied to clipboard

Can we make it more performant

Open dineshba opened this issue 6 years ago • 1 comments
trafficstars

For a codebase which had 600 newly added files

time ~/.talisman/bin/talisman_darwin_amd64 --githook pre-commit >/dev/null

real    0m14.029s
user    0m12.035s
sys     0m2.216s

It is taking 14 seconds. Can we try to reduce it.

dineshba avatar Oct 12 '19 19:10 dineshba

Update:

For the vendor directory of talisman

real    0m2.707s
user    0m11.829s
sys     0m0.219s

Current stats:

GetDiffForStagedFiles: git repo additions took 448.128554ms detector.FileNameDetector took 67.564441ms *detector.FileContentDetector took 246.185828ms *detector.PatternDetector took 1.867180727s

Room for next improvement is *detector.PatternDetector. Currently it is iterating all patterns for each addition n times. Do you think it is possible to do this in one pass of an addition?

Example: RegexSet in Rust regexp library.

I explored about this. Any idea if we could do this in Golang?

aswinkarthik avatar Oct 19 '19 05:10 aswinkarthik