Recent refactor results in significant performance hit
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- api, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 361
- Fork
- 58
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PokeAPI/pokebase
-
Status updateĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của PokeAPI/pokebase
Issue tương tự
-
Broken links found in docsĐang mởdocs pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
pydantic/pydantic-ai#8863 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
run-llama/llama_index#23278 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
documentation from-review-extraction github-actions priority: low severity:nit
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
LearningCircuit/local-deep-research#6946 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
oracle/langchain-oracle#323 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
tenstorrent/tt-metal#58057 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày