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

Is there any possible GetCellFormula faster? #1961

Open
ShowerBandV opened this issue Jul 22, 2024 · 2 comments
Open

Is there any possible GetCellFormula faster? #1961

ShowerBandV opened this issue Jul 22, 2024 · 2 comments

Comments

@ShowerBandV
Copy link
Contributor

Description
A sheet which has 4600 rows and 55 cols, and some cols have formulas,I want to get them,it seems no problem but the time cost is very large,I want to know whether excelize can solve this.

here is demo code and file

func TestGetFormulas(t *testing.T) {
	file, err := excelize.OpenFile("4600Formulas.xlsx")
	if err != nil {
		panic(err)
	}
	begin := time.Now()
	for col := 0; col < 55; col++ {
		for row := 0; row < 4600; row++ {
			axis := AxisEncode(col, row)
			_, err := file.GetCellFormula("Sheet1", axis)
			if err != nil {
				panic(err)
			}
		}
	}
	fmt.Printf("GetCellFormula time cost:%dms", time.Since(begin).Milliseconds())
}

4600Formulas.xlsx

@HZL3151904214
Copy link

HZL3151904214 commented Aug 14, 2024

共享函数的实现有问题,理论上共享函数应该单独存储一个共享函数的索引结构吧,不应该为了获取共享函数的表达式在多遍历一次m * n,这样一旦是共享函数就需要m * n * m * n,性能太差了。作者这块有规划优化下?

@xuri
Copy link
Member

xuri commented Aug 14, 2024

Thanks for the feedback. If you would like to create a pull request for this, that would be great.

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

No branches or pull requests

3 participants