Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: AdjustToContent is very slow

$
0
0
Calling this function on a 9M xlsx file takes about 2 minutes time. In contrast, saving the file only takes several seconds.

My profiling shows the hotspot is Bitmap creation in FontBaseExtensions.GetWidth function (or maybe GraghUtils.MeasureString?). Maybe a quick fix is to cache the bitmap object (or the graphics object instead) in MeasureString to avoid creating them every time.

Here's my profiling result:
Image
Image

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>