Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Recent refactor results in significant performance hit

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

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Start by running speed-test.py and speed-test-old.py, then compare the cached retrieval paths entered through pokebase.cache.set_cache and pokebase.api.set_cache. Trace the call from pokebase.pokemon('jigglypuff') and identify why the refactored cached path is slower. Done means cached retrieval returns to the earlier timing range without changing the demonstrated behavior.

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

Descripción

I was looking at the current state of the refactor, and noticed that there's a significant performance drop off (about an order of magnitude) from the changes.

Namely, once the cache is set, retrieving a pokemon takes an order of magnitude longer (jumping from taking ~.25s to ~3s).

 ~/programming/pokebase (pre-refactor)$ time python3 speed-test-old.py 

real	0m41.041s
user	0m0.796s
sys	0m0.065s
 ~/programming/pokebase (pre-refactor)$ time python3 speed-test-old.py 

real	0m0.241s
user	0m0.217s
sys	0m0.021s
 ~/programming/pokebase (pre-refactor)$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
 ~/programming/pokebase (master)$ time python3 speed-test.py 

real	0m31.404s
user	0m1.572s
sys	0m0.546s
 ~/programming/pokebase (master)$ time python3 speed-test.py 

real	0m3.095s
user	0m0.940s
sys	0m0.482s
 ~/programming/pokebase (master)$ cat speed-test.py 
import pokebase
from pokebase.cache import set_cache

set_cache('speed-test-cache')

pokebase.pokemon('jigglypuff')
 ~/programming/pokebase (master)$ cat speed-test-old.py 
import pokebase
from pokebase.api import set_cache

set_cache('speed-test-cache-old')

pokebase.pokemon('jigglypuff')

Originally posted by @jrubinator in https://github.com/GregHilmes/pokebase/issues/10#issuecomment-414134798

Lenguaje dominante
Python
Estrellas
361
Forks
58
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

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 PokeAPI/pokebase

Todos los issues de PokeAPI/pokebase

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.