Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#1,683 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
55/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
dart
Domínio
database, testing

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.
Linguagem predominante
Dart
Estrelas
23
Forks
1
Merge médio
32min
PRs com merge (30d)
537

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de QueryaHub/Querya-Desktop

Todas as issues de QueryaHub/Querya-Desktop

Issues semelhantes

Mais issues de Dart

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.