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
What is the current behavior?
Saving the workbook takes longer than on previous versions. Profiler tells us that 50% of the time is spent in GetHashCode() where most of the time is spent in ToUpperInvariant() (causing a subsequent GC):
There are a few more places. I think all GetHashCode() implementations needs an overhaul. In general, you must never allocate heap objects in GetHashCode! This is the perfect performance killer (especially if your application has high memory pressure).
Did this work in previous versions of our tool? Which versions?
It worked a bit better in 0.90.0. (But there we had crazy delays in IsEmpty() method instead.)
The text was updated successfully, but these errors were encountered:
@znakeeye could you provide an example you used as a benchmark? I admit, that using ToUpperInvariant in GetHashCode was not a brilliant idea, but did not see 50% performance hit either.
Version of ClosedXML
0.93.1
What is the current behavior?
Saving the workbook takes longer than on previous versions. Profiler tells us that 50% of the time is spent in
GetHashCode()
where most of the time is spent inToUpperInvariant()
(causing a subsequent GC):https://github.com/ClosedXML/ClosedXML/blob/develop/ClosedXML/Excel/Style/XLFontKey.cs#L63
https://github.com/ClosedXML/ClosedXML/blob/develop/ClosedXML/Excel/Style/XLNumberFormatKey.cs#L15
There are a few more places. I think all
GetHashCode()
implementations needs an overhaul. In general, you must never allocate heap objects in GetHashCode! This is the perfect performance killer (especially if your application has high memory pressure).Did this work in previous versions of our tool? Which versions?
It worked a bit better in 0.90.0. (But there we had crazy delays in IsEmpty() method instead.)
The text was updated successfully, but these errors were encountered: