gitlabhq/gitlabhq — pull request #1613 by tsigo (2012-10-02 23:32:50+00:00)
Title: Improve performance of Commits#show

Commit#safe_message was getting called several times for every commit
message, which slowed down the "Commit History" page quite a bit because
it was constantly converting the same message to utf8.

Benchmarks:

```
Calling `commit.title` on the same commit, 500 times each run:

user system total real
performance branch: 0.600000 17.450000 18.050000 ( 18.058806)
master branch: 2.520000 280.670000 283.190000 (283.191723)
```

In terms of actual performance, on the master branch it takes my system
about 3.5 to 4 seconds to load the first page of the commit history for
GitLab itself in the development environment, and after this change it
takes about 800 ms. That number should still be lower, but this is a
start.