For directories with lot of (few thousand) files, https://github.com/gogits/git-module/blob/master/tree_entry.go#L160 time.Sleep(200*time.Millisecond) adds up. By commenting it out, a 20s page rendering goes down to 1.6s (I was searching for solution for https://github.com/gogits/gogs/issues/1518) Is that sleep required?