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

Reduce number of loops in tracker #206

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

Conversation

ZhiyuanChen
Copy link

Slightly increase spped by reducing two for loop to one

Slightly increase spped by reducing two for loop to one
@alexnguyen2201
Copy link

alexnguyen2201 commented May 1, 2020

@zyc-ai a comprehension list is faster than a loop

@ZhiyuanChen
Copy link
Author

a comprehension list is faster than a loop

It seems not in the case of Python https://stackoverflow.com/a/43677631/8791650.

@kanasite
Copy link

kanasite commented Nov 3, 2020

a comprehension list is faster than a loop

It seems not in the case of Python https://stackoverflow.com/a/43677631/8791650.

I beg to diff, consider doing this instead

def square_sum4(numbers):
return(sum([i**2 for i in numbers]))

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.

3 participants