Skip to content

Use a faster deepcopy library #2029

Closed
@Juneezee

Description

@Juneezee

Description

We currently use the deepcopy function from https://github.com/mohae/deepcopy to duplicate columns, rows, and worksheets, as shown in the following references:

excelize/col.go

Line 536 in 5f446f2

c := deepcopy.Copy(col).(xlsxCol)

excelize/col.go

Line 554 in 5f446f2

c := deepcopy.Copy(column).(xlsxCol)

rowCopy = deepcopy.Copy(ws.SheetData.Row[i]).(xlsxRow)

cfCopy := deepcopy.Copy(*cf).(xlsxConditionalFormatting)

dvCopy := deepcopy.Copy(*dv).(xlsxDataValidation)

column := deepcopy.Copy(ws.Cols.Col[left]).(xlsxCol)

worksheet := deepcopy.Copy(sheet).(*xlsxWorksheet)

The https://github.com/mohae/deepcopy library has not been updated in 7 years (last commit was September 2017). We should opt for a newer deep copy library.

I suggest we switch to https://github.com/tiendc/go-deepcopy. The benchmarks indicate that it is faster than other popular deep copy libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions