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
In my case replacing IXLRows.Delete() by IXLRange.Delete() has huge performance gains.
publicvoidDelete(){if(_worksheet!=null){
_worksheet.Internals.RowsCollection.Clear();
_worksheet.Internals.CellsCollection.Clear();}else{vartoDelete=newDictionary<IXLWorksheet,List<Int32>>();foreach(XLRow r in Rows){if(!toDelete.TryGetValue(r.Worksheet,outList<Int32> list)){list=newList<Int32>();
toDelete.Add(r.Worksheet, list);}
list.Add(r.RowNumber());}foreach(KeyValuePair<IXLWorksheet,List<int>> kp in toDelete){foreach(int r in kp.Value.OrderByDescending(r => r))
kp.Key.Row(r).Delete();}}}
The text was updated successfully, but these errors were encountered:
sechel
changed the title
IXLRows runtime is quadratic
IXLRows delete method's runtime is quadratic
Jan 16, 2024
In contract to what is stated in the documentation the runtime of
IXLRows.Delete()
is quadratic, seeClosedXML/ClosedXML/Excel/Rows/XLRows.cs
Line 80 in a4f2312
In my case replacing
IXLRows.Delete()
byIXLRange.Delete()
has huge performance gains.The text was updated successfully, but these errors were encountered: