Project

General

Profile

Actions

Patch #29359

closed

Switch to mini_mime from mime-types

Added by Pavel Rosický over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Redmine uses unbound cache for mime types which is eliminated now. Also mime-types is too heavy and Redmine uses only a tiny peace of it, we just need a simple ext -> mime lookup.

https://github.com/mikel/mail/pull/1059 (mail 2.6.x still uses mime-types)
https://github.com/teamcapybara/capybara/pull/1884

require 'benchmark/ips'

Benchmark.ips do |x|
  x.report('known')     { Redmine::MimeType.of("file.patch") }
  x.report('not known') { Redmine::MimeType.of("file.zip")   }
end
trunk
               known    284.431k (± 1.9%) i/s -      1.422M in   5.002378s
           not known    285.699k (± 3.0%) i/s -      1.446M in   5.065113s
patch
               known    657.114k (± 1.8%) i/s -      3.327M in   5.064494s
           not known    392.574k (± 2.2%) i/s -      1.965M in   5.006827s
                boot allocations boot retained
mime-types                109796         31165
mini_mime                    398            62

what do you think?


Files


Related issues

Related to Redmine - Defect #29365: MailHandlerTest#test_add_issue_with_localized_attributes fails with mail gem 2.7.0Closed

Actions
Related to Redmine - Patch #29383: Update mini_mime gem (~> 1.0.1)Closed

Actions
Related to Redmine - Feature #29443: Update mail gem (~> 2.7.1)ClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF