http://api.drupal.org/api/function/file_get_mimetype
Goes through a huge array and does preg_match() on each item.
Since #415710: Favicon.ico defaults to 'type="image/x-icon"' got in, this now happens on every page request. webgrind has this as 5ms / 2% of the page request - that's for a single call to file_get_mimetype().
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | ab.txt | 3.15 KB | catch |
| #1 | mapping.patch | 1.69 KB | catch |
| file_get_mimetype.png | 54.29 KB | catch |
Comments
Comment #1
catchSo it's a bit of a hack, but put .ico as the first item of the array.
webgrind reports 5ms down to 0.2ms for time spent.
HEAD:
10.53 [#reqs/sec]
Patch:
10.57 [#reqs/sec]
Comment #2
lilou commentedComment #3
catch#473652: file_get_mimetype() unneeded loop