Skip to content

[BUG] Slow generation performance #2041

Open
@hfhchan

Description

@hfhchan

🐛 Bug Report

We are generating an Excel file with lots of rows but minimal formatting. We've found that the writeBuffer() call will spend aggregated 20.85s in addStyleModel() and only 5s in addWorksheets().

One of the bottlenecks seem to be using the serialized XML as the key on this.index.style in _addStyle(). We tried passing an Int16Array into the method and keying it on ${style[0]},${style[1]},${style[2]},${style[3]},${style[4]},${style[5]} instead, which reduced it to 17.12s.

We also observed that the style objects for each cell were always a different object, so the weakmap was never used. Combined with removing the weakmap checks, the total aggregate time of addStyleModel() was reduced to 558ms.

Lib version: 4.2.1

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