PostHog client is initialized unconditionally during fish shell completion, adding ~10 seconds to every completion

Abierto
#506 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
fish, python
Área
cli, performance

Línea de trabajo

Empieza siguiendo el punto de entrada de la finalización de fish y la invocación repetida del comando comfy; después, sigue el inicio de CLI hasta donde se inicializa PostHog. Compara el tiempo de finalización con Analytics habilitado y suprimido; se considera terminado cuando la finalización ya no realiza una inicialización innecesaria de telemetría y se reduce el retraso informado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

On my system, each completion invocation takes approximately 10.6 seconds because importing the CLI unconditionally initializes a PostHog background worker and completions invoke the comfy command twice. Suppressing PostHog reduces completion to roughly 0.8 seconds because the CLI is executed twice.

IDK if the fact that I have strict DNS blocking is what’s causing posthog to take the full 5s each time, but it seems possible

Therefore, there appear to be two related performance problems:

  1. Shell completion invokes the entire CLI twice per completion attempt.
  2. CLI startup eagerly initializes telemetry and other command infrastructure that completion does not need.

Analytics are disabled in my configuration, which makes the unconditional PostHog initialization additionally surprising.

Environment

  • comfy-cli: 1.12.0
  • Shell: Fish
  • OS: Linux
  • Analytics disabled in the Comfy configuration
  • DNS-level tracking-domain blocking is enabled

Reproduction

Compare an ordinary invocation of tabbing for a completion in fish shell then:

set -gx POSTHOG_API_KEY

It’s still kinda slow but it’s way more usable when you don’t post your hog each completion (~10s reduced to ~1s)

Lenguaje dominante
Python
Estrellas
1k
Forks
176
Merge medio
1 d 11 h
PR fusionados (30 d)
87

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Comfy-Org/comfy-cli

Todos los issues de Comfy-Org/comfy-cli

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.