You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimize ToFlatOpcString to reduce memory usage and improve performan… (#1863)
## Optimized the ToFlatOpcString method to address high memory usage and
improve performance.
The previous implementation relied on LINQ, which created a significant
amount of intermediate collections and dictionaries, leading to
inefficiency, especially when working with Word documents containing
images.
This update removes unnecessary LINQ operations and reduces memory
overhead, replace manual chunking logic with Convert.ToBase64String
using Base64FormattingOptions.InsertLineBreaks.
This approach eliminates the need for LINQ-based chunking and
aggregation, resulting in cleaner, more efficient code while adhering to
the MIME specification for line breaks in Base64 encoding.
A sample benchmark output when working with a 822KB-word document.

Co-authored-by: Dat Hoang Quoc <[email protected]>
Co-authored-by: Taylor Southwick <[email protected]>
0 commit comments