fe0898cc14
We removed calls from our code to Rugged::Repository#fetch_attributes:
<340e111e04
>
However, we didn't remove calls from within Linguist. This method is only called
when calculating the languages for a repository on the Charts page:
<https://github.com/github/linguist/blob/v4.7.0/lib/linguist/lazy_blob.rb#L33-L36>
We can safely use our own Gitlab::Git::Attributes here. On staging, for the
GitLab CE repo, this makes the calculation take about a third of the time:
# Before
Benchmark.realtime do
Linguist::Repository.new(repository.rugged,
repository.rugged.head.target_id).languages
end
#=> 23.67193900188431
# After
Benchmark.realtime do
Linguist::Repository.new(repository.rugged,
repository.rugged.head.target_id).languages
end
#=> 8.945212290156633
4 lines
85 B
YAML
4 lines
85 B
YAML
---
|
|
title: Speed up used languages calculation on charts page
|
|
merge_request:
|
|
author:
|