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

chore(data-structures): low-priority follow-ups from a data-structure review

Aperta
#1,683 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à
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
dart
Ambito
database, testing

Direzione di ricerca

Start with lib/core/database/connection_pool_lock.dart and add tests for concurrent callers, separate keys, and synchronous or asynchronous failures; the issue says the class currently has no tests. Check the three pool implementations for PostgreSQL, MySQL, and SQLite when judging whether re-entrancy matters. Done means the tests establish the intended behavior and _lock is removed or its purpose is documented; the boolean-column and interning ideas are explicitly conditional.

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

Descrizione

enhancement

Findings from a review of the data structures, checked against dev. The two that pay off are in #1682 (Redis folder key count, groupings number parsing). What is left is small; each item says whether it is worth doing.

1. PoolEntryLock._lock is never active (worth a test first)

lib/core/database/connection_pool_lock.dart: createIfAbsent sets _lock, runs a block with no await, and clears it in finally in the same turn, so the while (_lock != null) await _lock loop never waits. De-duplication really comes from _pending[key]. The one thing the lock changes is re-entrancy: a call to createIfAbsent made from inside create() waits instead of running at once. The class has no tests and three pools use it (PostgreSQL, MySQL, SQLite).

  • Add tests: two callers, one key, one create(); two keys in parallel; a failing create() clears the entry; create() that throws synchronously.
  • Then drop _lock (or keep it and say why in the doc comment).
2. BooleanCompactColumn (probably not worth it)

Boolean columns are stored as 0/1 in Int64List (8 bytes per row, about 790 KB per column at 100k rows more than a bit array). A packed column touches formatting, sort, type detection and export. Only do this if a profile shows boolean columns dominating the heap.

3. StringInternPool does not evict

When maxEntries (4096) is reached, new strings are simply not interned. That is the right trade for a bounded pool; an LRU would add bookkeeping to a hot path. Only revisit if results with more than 4096 distinct short values are common.

Considered and rejected
  • MetricHistory.record uses removeRange(0, 1) on a list of at most 120 samples every 5 s: a copy of 120 references. A ring buffer would be more code for no visible gain.
  • GenericCompactColumn.formatter and isolates: noted on #1549, where the isolate hand-off is in scope.
Lingua principale
Dart
Stelle
23
Fork
1
Merge medio
32m
PR unite (30g)
537

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 QueryaHub/Querya-Desktop

Tutte le issue di QueryaHub/Querya-Desktop

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.