qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
18.05k stars 1.71k forks source link

Flamegraph of `CalcCellValue` shows lots of time spent doing `runtime.duffcopy` inside `getSharedFormula` #1836

Closed paolobarbolini closed 7 months ago

paolobarbolini commented 7 months ago

Description

runtime.duffcopy is showing up taking a substantial amount of time in flamegraphs of CalcCellValue.

image

Steps to reproduce the issue:

  1. Open an Excel containing many formulas
  2. Call CalcCellValue on a cell containing a formula referencing many other cells
  3. The flamegraph will show runtime.duffcopy taking a long time

Output of go version:

go version go1.22.0 linux/amd64

Excelize version or commit ID:

9d4c2e60f66b
xuri commented 7 months ago

Thanks for your issue. The pull request has been merged, and this patch will be released in the next version.