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

Closed Issue: Conditionally Formatted row delete slow [8309]

$
0
0
Great product, I really appreaciate the time you took to develop this.
 
I am running into a performance issue when deleting a row.
When a range is conditionally formatted and a row is deleted, it is extremely slow and uses a ton of memory.
 
Running the code below with the sample files
Conditional Time : 43.222
Time : 0.061
 
 
DateTime start = DateTime.Now;
using (XLWorkbook b = new XLWorkbook("C:\\conditional_format_test.xlsx"))
{
 
IXLWorksheet sh1 = b.Worksheets.Worksheet(1);
IXLRange insertRange = sh1.Range("B1:C10");
 
sh1.Row(5).Delete();
sh1.Row(5).Delete();
 
b.SaveAs("C:\\conditional_format_test_Modify.xlsx");
}
 
System.Diagnostics.Trace.WriteLine("Conditional Time : " + (DateTime.Now - start).TotalSeconds.ToString());
 
start = DateTime.Now;
using (XLWorkbook b = new XLWorkbook("C:\\test.xlsx"))
{
 
IXLWorksheet sh1 = b.Worksheets.Worksheet(1);
IXLRange insertRange = sh1.Range("B1:C10");
 
 
sh1.Row(5).Delete();
sh1.Row(5).Delete();
 
b.SaveAs("C:\\test_Modify.xlsx");
}
 
System.Diagnostics.Trace.WriteLine("Time : " + (DateTime.Now - start).TotalSeconds.ToString());
Comments: Please try the latest version of ClosedXML (v0.87.1 at this stage). If you still experience the issue, log it on the new GitHub page.

Viewing all articles
Browse latest Browse all 1877

Trending Articles