Adding link data severely degrades write performance #2537
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2537
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If I add link data to cells, the time it takes to write the file seems to explode exponentially:
In comparison, generating cells without link data, takes only a fraction of the time:
Test code:
Feel free to send a PR, the modifications are to
bits/31_rels.js
:To summarize: each link must be generated and assigned a relationship ID within the worksheet relationships file. Not anticipating a huge number of links, the code does a simple linear scan when a new link is requested. The patch just caches the next expected target ID. Please confirm the output is as expected and the performance is a lot more reasonable, then send a PR.
It's not using an array because theoretically a relationship id can start with something other than
rId
.PS: there is a limit of 65530 links per worksheet that is not currently enforced -- should the library throw an error or do something if there are too many links?