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().

CommentFileSizeAuthor
#1 ab.txt3.15 KBcatch
#1 mapping.patch1.69 KBcatch
file_get_mimetype.png54.29 KBcatch

Comments

catch’s picture

StatusFileSize
new1.69 KB
new3.15 KB

So 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]

lilou’s picture

Status: Active » Needs review
catch’s picture

Status: Needs review » Closed (duplicate)