-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
homework_04 #1267
base: master
Are you sure you want to change the base?
homework_04 #1267
Conversation
# быстрее, чем python2, при этом циклы for для больших | ||
# массивов стали работать практически | ||
# со скоростью list comprehension, в то время как в python2 | ||
# разница для больших списков была почти двукратной |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
# --- | ||
|
||
# Что и требовалось доказать, мемоизация в данном случае | ||
# делает только хуже |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мемоизация здесь просто не нужна
но нужна. если делать много вызовов
# cProfile строит свою статистику на основе измерений вызовов | ||
# всех функций. Очевидно, при таком подходе чаще всего | ||
# вызывается revers_2(0). При усреднении это приводит | ||
# к занижению результатов по времени. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Остается неясным, почему cProfile и timeit
cProfile - 1 запуск
timeit - number запусков
# 0.00952054699882865 | ||
# --- | ||
|
||
# Здесь самым быстрым является алгоритм №3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
здесь решается в одну строку - ф-ция max
посмотрите пример
# 42.7186805739766 | ||
# 104729 | ||
# 0.1595245740027167 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нет аналитики, где Решето эффективнее и почему
No description provided.