Commit 7546168
committed
mimetypes: keep track of whether extra mimetype exists
In the BinaryProvider backend each mimetype optionally has additional
data in an XML file.
For each mimetype this data is cached in m_mimetypeExtra. However, if a
mimetype does not have any additional data this code returns early
without caching anything.
This causes an additional access and open call for every mimetype for
each lookup of globPatterns.
Given we have typically have hundreds of mimetypes and applications may
need to look up thousands of files this becomes a very hot path that
should not be making system calls after the first time.
This patch should improve performance but not make any behavioural
changes. All callers treat an invalid iterator the same as the default
MimeTypeExtraMap.
Change-Id: Ibe415ec4e70198655d7a6ad610664fe54e3b9215
Reviewed-by: Thiago Macieira <[email protected]>
Reviewed-by: David Faure <[email protected]>1 parent e27d5fc commit 7546168
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | | - | |
516 | | - | |
| 515 | + | |
| 516 | + | |
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
527 | 527 | | |
528 | | - | |
529 | 528 | | |
530 | 529 | | |
531 | 530 | | |
| |||
0 commit comments