diff options
author | Drew Blessing <drew@blessing.io> | 2018-10-18 03:03:15 +0300 |
---|---|---|
committer | Drew Blessing <drew@blessing.io> | 2018-10-31 23:50:30 +0300 |
commit | 409f2f4dd2888f88df2293466c37c768b94068e5 (patch) | |
tree | c8061f8135e6657d7a7185f0f56e5757b4c5f0a0 /app/helpers/icons_helper.rb | |
parent | 43463869c883c7972ecc03500ab35325eede7a01 (diff) |
Improve performance of tree rendering in repositories with lots of items
Rails is slow to generate paths dynamically especially when called
hundreds/thousands of times. Also, rendering many partials hundreds
of times can be slower. This change reduces the number of partials
rendered and introduces two fast path methods to speed up path
generation.
Diffstat (limited to 'app/helpers/icons_helper.rb')
-rw-r--r-- | app/helpers/icons_helper.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index 037004327b9..56ffd145f65 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -109,6 +109,8 @@ module IconsHelper def file_type_icon_class(type, mode, name) if type == 'folder' icon_class = 'folder' + elsif type == 'archive' + icon_class = 'archive' elsif mode == '120000' icon_class = 'share' else |