Visitar URL original
Investigate comment and hyperlink loading strategies before 4.0 · Issue #783 · ExcelDataReader/ExcelDataReader · GitHub
Skip to content

Investigate comment and hyperlink loading strategies before 4.0 #783

Open

Description

@appel1

Comments and hyperlinks are currently loaded on demand and cached per worksheet. This avoids collecting things the caller doesn't need, but for XLS and SpreadsheetML it means scanning the sheet twice if both are requested. For XLSX/XLSB, comments are stored separately, so only hyperlinks require another sheet scan.

We could collect these during the initial scan in two-pass mode instead. But unlike most of what we collect there today, comments and links can contain quite a lot of text. Doing this automatically could add unnecessary allocations. Making it opt-in seems more reasonable.

SinglePassMode would still need lazy loading, since the metadata can appear after the cells it belongs to.

Activity

  1. added this to the 4.0 milestone on Oct 25, 2026
  2. Sinkleberg commented on Nov 10, 2026

    @Sinkleberg

    I tested the opt-in approach on a synthetic 2,048-row SpreadsheetML sheet with dense comments and hyperlinks. When the caller requested both, collecting them during the initial scan saved two later scans (3.16 MB read from the input stream). The returned cells, comments and links matched the lazy reader.

    The tradeoff showed up when the caller requested neither. Always collecting both raised managed allocations from 1.09 MB to 9.22 MB. Collecting only what was requested kept it at 1.09 MB.

    That supports keeping lazy loading as the default and offering an opt-in for two-pass reads. One detail worth documenting is that an opted-in reader can report a malformed comment during initialization. Single-pass reads stayed lazy in this experiment.

    I used Codex for the local prototype and tests on Windows. The comparison covers SpreadsheetML only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions