| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…once Instead of once per property. As there are multiple properties, and all have the same code page, we can call Encoding.GetEncoding once and use it for all the properties, rather than calling GetEncoding per property. This actually gives a measurable performance increase when reading DocumentSummaryInformation property streams with UserDefined properties.
|
We could probably do something similar with the reading of LPSTR properties, but that's not so self contained so that's just a future thought. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
…once
Instead of once per property.
As there are multiple properties, and all have the same code page, we can call Encoding.GetEncoding once and use it for all the properties, rather than calling GetEncoding per property.
This actually gives a measurable performance increase when reading DocumentSummaryInformation property streams with UserDefined properties.
This was an observation whilst doing #420 that I noticed when I changed a Unicode case to always use Encoding.Unicode instead of calling Encoding.GetEncoding and it got faster (GetEncoding appears to do some internal locking that we can skip by only doing it once, at least when all the additional code pages have been registered in PropertyFactory)
I currently get these benchmark results with the main branch:
But after this change I get
The Unicode case gets a bigger difference because the test file contains more properties.
Seems worth doing though when it's quite simple.