Skip to content

High CPU usage of writer buffer #2207

@guosgbin

Description

@guosgbin

Description

If the generated Excel file is relatively large, when calling the excelize.(*File).Write method, the CPU usage will be very high, resulting in CPU spikes. May I ask if there are any solutions?

Steps to reproduce the issue

I generated a 20MB file, but the CPU usage is relatively high, this is a flamegraph.

Describe the results you received

Image

The main CPU usage is in flate.(*compressor).deflate, but I haven't found a more efficient writing API provided by excelize.

Describe the results you expected

I hope there is a more efficient API for writing, or other solutions.

Go version

1.22

Excelize version or commit ID

2.4.1

Environment

test Environment: MacOS

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions