Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

homework_04 #1267

wants to merge 1 commit into from

Conversation

erinar
Copy link

@erinar erinar commented Mar 31, 2021

No description provided.

# быстрее, чем python2, при этом циклы for для больших
# массивов стали работать практически
# со скоростью list comprehension, в то время как в python2
# разница для больших списков была почти двукратной
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

# ---

# Что и требовалось доказать, мемоизация в данном случае
# делает только хуже
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мемоизация здесь просто не нужна
но нужна. если делать много вызовов

# cProfile строит свою статистику на основе измерений вызовов
# всех функций. Очевидно, при таком подходе чаще всего
# вызывается revers_2(0). При усреднении это приводит
# к занижению результатов по времени.
Copy link
Owner

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,
Copy link
Owner

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет аналитики, где Решето эффективнее и почему

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants