unvell / ReoGrid

Fast and powerful .NET spreadsheet component, support data format, freeze, outline, formula calculation, chart, script execution and etc. Compatible with Excel 2007 (.xlsx) format and working on .NET 3.5 (or client profile), WPF and Android platform.
https://reogrid.net
MIT License
1.33k stars 394 forks source link

performance issue #511

Open Johnson1207 opened 11 months ago

Johnson1207 commented 11 months ago

Description

The performance will significantly degradation as the visible cells increase after I changed the background color of each cell.

Reproduce

  1. Create a ReoGrid control with a grid size larger than 100*100.
  2. Programmatically update the style of the cells (background color, text color, etc.). I'm using sheet.Cells[y, x].Style.BackColor = unvell.ReoGrid.Graphics.SolidColor.SeaGreen;
  3. Observe the performance, especially the responsiveness of the UI (including slow response times when selecting cells or scroll the grid.), as more cells are visible.

Edition

Which edition of ReoGrid do you using?

Environment

jingwood commented 11 months ago

The WPF edition experiences performance issues when numerous cells have background fill colors. ReoGrid renders cell backgrounds one by one, which is not a significant problem on the Windows Forms platform but can be slow on the WPF platform due to the slower graphics rendering in WPF. We have identified this issue and are actively working on finding ways to resolve it in the next version. Thanks for your reporting.

Johnson1207 commented 11 months ago

Thank you for your prompt response to this issue. I have further observed that the performance issue is not only limited to updating cell styles but also occurs when inserting a single character into each cell of the grid. The performance bottleneck might be broader than initially anticipated. Any improvement to address this would be greatly appreciated.

CanadianHusky commented 11 months ago

Respectfully, I would like to comment about performance. I am aware that my suggestion may not be relevant (or too late) for @Johnson1207 because your project is already fully committed to WPF platform. I use Reogrid Winforms edition with grid sizes of 30 to 50 cols x 10,000 rows and many cells with background color, custom styles etc. Performance for scrolling, selection, editing is brilliant and UI updates are in the range of milliseconds, invisible to the user. Any application that is serious about performance is better off with (old school) robust Winforms platform. I tried a few WPF tests and besides doing some fancy UI styling and markups, there is nothing fundamentally to gain by using WPF. You are giving up significant performance when choosing WPF over Winforms, not just in Reogrid but every part of the UI when it comes to high performance. This is my personal opinion based on experience and not a recommendation for your particular case.