Skip to content

Use mmap if possible (can save memory with big files) #2121

Open
@tgulacsi

Description

@tgulacsi

Description

ReadAll is used only in a few places, but most dominantly it is used to slurp up all the .xlsx we are opening.
It may be only a few MiBs, but mmap is an easy solution for this.

Steps to reproduce the issue

  1. open a big .xlsx
  2. Check used memory and GC churn

Describe the results you received

At least the size of .xlsx is used, then later may be released.

Describe the results you expected

Not a lot of memory is used, GC is in peace

Go version

1.24.1

Excelize version or commit ID

2.9.0

Environment

Debian Linux testing

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions