Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

A non-empty spreadsheet cell builds three elements before any html limit applies

Aperta
#781 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
cpp
Ambito
performance

Direzione di ricerca

Start with ElementRegistry::Sheet::Cell and the pugi::xml_node it already holds, then trace how the registry tree is built and traversed as const. Compare this with sheet_rendered_extent in internal/html/document_element.cpp and the spreadsheet limit settings. Done means distinct non-empty cells no longer eagerly build paragraph/text children while preserving the required element-id and traversal behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Split out of #762, which #780 otherwise finishes. Numbers are against #780.

odr-private/ods/efficiency-big-1.ods decodes into 3.16M registry elements for
1.05M cells: parse_sheet creates a sheet_cell element and then
parse_any_element_children builds a paragraph and a text for the cell's
<text:p>Genius</text:p>. Every row of that file is the same three cells and the
rows are not number-rows-repeated-compressed, so each one is distinct and
none of the collapsing added in #776 applies.

Empty cells already cost nothing — is_cell_empty registers a range entry with a
null element id and no element at all — and since #776 a repeated cell with
content is one entry too. This is the remaining case: a distinct non-empty
cell
, expanded eagerly.

What it costs

Per cell, after #780:

sheet_cell, paragraph, text elements 3 x 32 B
m_sheet_cells entry (position + repeated flag) 16 B
m_texts entry (the run's last node) 16 B
sheet index Cell (range end, element id, node) 16 B
144 B

which is ~150 MB of the 626 MB peak on that file. Making the children lazy is
worth the paragraph, the text and the m_texts entry — ~85 MB — and leaves
~68 MB for the cells themselves.

HtmlConfig::spreadsheet_limit and spreadsheet_cell_limit do not bound any of
it: they are applied in sheet_rendered_extent (internal/html/document_element.cpp),
long after odf::Document's constructor has built the whole tree. A 100-row,
2000-cell budget costs exactly as much as the default one.

Options

  • Lazy children. ElementRegistry::Sheet::Cell already holds the
    pugi::xml_node, so a cell's children can be built on first access. The
    registry is a pre-built tree today and traversal is const, so this needs an
    on-demand builder and a decision about what an element id means before its
    element exists.
  • Bound the parse. Let the cell budget reach decode time so the parser stops
    registering content past it. Cheaper, but it makes the model depend on the
    render config, which the architecture deliberately keeps apart.

The first is the one that generalises: it is the same lifetime question a
streaming decode asks (see the sibling issue), so it is worth doing first and
learning from cheaply.

Lingua principale
C++
Stelle
41
Fork
10
Merge medio
12h 4m
PR unite (30g)
297

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opendocument-app/OpenDocument.core

Tutte le issue di opendocument-app/OpenDocument.core

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.