Paul's Blog Google Summer of Code 2018

Week 13

Hello,

Last days I have been working to remove the old shell script and to optimize the C version. There were also some memory leaks and I hope I got rid of all of them. You may want to know if there is any notable difference. I runned time on t3903-stash.sh with the shell version and the C version of stash. I know this is not the best way to test the performance. I talked with dscho, my mentor, and he told me about profiler tools integrated in Visual Studio (for Windows) and OProfile (for Linux). I haven’t tried them yet, but I will definitely use at least one of them. I want to make stash as fast as I can. Anyway, about time… shell version took ~12s to run, almost-C version ~9s and C version ~3 seconds.

In shell version, when using git stash push -u, no_changes() was called 2 times and untracked_files() 3 times even though the output was the same. A very easy “fix” for this (to call the functions only 1 time) was to introduce a new variable to know if we already called them.