chore(data-structures): low-priority follow-ups from a data-structure review
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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 failingcreate()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.recordusesremoveRange(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.formatterand isolates: noted on #1549, where the isolate hand-off is in scope.
- Dominant language
- Dart
- Stars
- 23
- Forks
- 1
- Avg merge
- 49m
- Merged PRs (30d)
- 496
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QueryaHub/Querya-Desktop
-
bug P3 ux
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
QueryaHub/Querya-Desktop#1837 ·
Maintainers usually reply within 1 day
-
enhancement P3
Difficulty 4/5 3-5 days Newbie friendliness 50/100
QueryaHub/Querya-Desktop#1838 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
QueryaHub/Querya-Desktop#1690 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
QueryaHub/Querya-Desktop#1625 · 2 comments ·
Maintainers usually reply within 1 day
-
epic flathub
Difficulty 4/5 3-5 days Newbie friendliness 25/100
QueryaHub/Querya-Desktop#1583 ·
Maintainers usually reply within 1 day
All issues in QueryaHub/Querya-Desktop
Similar issues
-
area/ci-build bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
DarkFlippers/qUnleashed#423 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
google/skills_lint.dart#152 ·
Maintainers usually reply within 1 day
-
Docs: correct the unbuilt "full re-verify" claim and three untrue sync commentsPossibly taken @ibanner56 claimed this today. Openarea: sync priority: low severity: trivial type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ibanner56/CallersCompendium#1942 ·
Maintainers usually reply within 1 day
-
[Bug]: 编辑器替换栏关闭按钮错位Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
appshubcc/Bettbox#584 · 1 comment ·
Maintainers usually reply within 1 day