perf(redis): sort key tree names without lower-casing on every comparison
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend, performance
Línea de trabajo
Empieza con RedisKeyTreeEngine.buildTree en lib/features/redis/redis_key_tree_engine.dart y las pruebas existentes de RedisKeyTreeEngine. Comprueba cómo se ordenan las hojas raíz, los nombres de carpetas y las hojas de carpetas; después, añade una prueba con mayúsculas y minúsculas mezcladas que incluya nombres iguales al ignorar las mayúsculas. La tarea estará terminada cuando las pruebas pasen, se conserve el comportamiento existente para desempatar y ningún comparador de ese archivo llame a toLowerCase().
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
RedisKeyTreeEngine.buildTree (lib/features/redis/redis_key_tree_engine.dart) sorts root leaves, folder names and each folder's leaves with
..sort((a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()))
so toLowerCase() runs twice per comparison, i.e. O(n log n) string allocations for an O(n) amount of information. A single folder with tens of thousands of keys (the common case for session:* / cache:*) pays for it when the tree is built.
Measurements
Standalone Dart AOT, names like Cache_123456789_Key:
| Names | toLowerCase() per compare |
Decorated (lowercase once, sort pairs) |
|---|---|---|
| 5,000 | 3.2 ms | 1.5 ms |
| 50,000 | 47.5 ms | 24.7 ms |
About 2x. Not per-frame work, but it is a one-off pause of ~50 ms on a big keyspace that also happens on every refresh.
Solution
- Sort decorated pairs
(lower, node)(or precomputelowerNameon the node) so the lowercase string is created once per element. - Same ordering as today (case-insensitive compare of the label); keep the existing tie-break behaviour.
Acceptance
-
RedisKeyTreeEnginetests unchanged and green; add a case with mixed-case and equal-ignoring-case names to pin the order. - No
toLowerCase()inside a comparator in that file. - Optional: same pattern checked in other comparators (
grep -rn "toLowerCase().compareTo"inlib/).
- Lenguaje dominante
- Dart
- Estrellas
- 23
- Forks
- 1
- Merge medio
- 31 min
- PR fusionados (30 d)
- 570
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de QueryaHub/Querya-Desktop
-
enhancement ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1689 ·
Los mantenedores suelen responder en 1 día
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowAbiertobug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
QueryaHub/Querya-Desktop#1642 ·
Los mantenedores suelen responder en 1 día
-
bug error-handling settings
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1637 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
QueryaHub/Querya-Desktop#1636 ·
Los mantenedores suelen responder en 1 día
-
enhancement marketplace
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1635 ·
Los mantenedores suelen responder en 1 día
Todos los issues de QueryaHub/Querya-Desktop
Issues similares
-
[Bug] Web Guide has broken linksAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
avdept/JellyBoxPlayer#375 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
basictech01/uniun#300 ·
Los mantenedores suelen responder en 1 día
-
Listener that removes itself in its callback causes other listeners to miss updatesPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
RevenueCat/purchases-flutter#1962 ·
Los mantenedores suelen responder en 1 día