Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase performance of many DuplicateRow calls #772

Open
AbraaoAlves opened this issue Jan 29, 2021 · 1 comment
Open

Increase performance of many DuplicateRow calls #772

AbraaoAlves opened this issue Jan 29, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@AbraaoAlves
Copy link

Description

File.DuplicateRow is a useful method for keep format and styles, but it can be worst if you need to work/duplicate more than 1k rows.

Describe the results you received:

If you run inside a loop 1000 times, File.DuplicateRow can spend 5-6s
If you run inside a loop 4000 times, File.DuplicateRow can spend 90-105s !!!

Describe the results you expected:
Maybe it's time to create a File.BunchRow(sheetName string, row int, n int) method. This new method can be create a single deepCopy of row and apply it for n rows inserted!

Remember: File.InserRow (adjustHelper internaly) is absurd faster than that.

@xuri xuri added the enhancement New feature or request label Jan 30, 2021
@xuri
Copy link
Member

xuri commented May 18, 2022

Sorry for my late reply. If you want to set the styles for multiple rows to keep format and styles, using the SetRowStyle function will get better performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants