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

PMVector sum is extremely slow #125

AtharvaKhare opened this issue May 26, 2019 · 1 comment · Fixed by #126

PMVector sum is extremely slow #125

AtharvaKhare opened this issue May 26, 2019 · 1 comment · Fixed by #126


Copy link

AtharvaKhare commented May 26, 2019

Here is the comparison with array:

a := ((1 to: 5000) collect: [ :i | i ]) asPMVector.
a sum. "Best of 10 runs: 568ms"

b := ((1 to: 25000000) collect: [ :i | i ]).
b sum. "Worst of 10 runs: 551ms"

This means that PMVector sum is at least 5,000 times slower than Collection sum.

Possible fix: Don't override sum method. Is there any specific reason to do so?

Copy link

SergeStinckwich commented May 26, 2019

I try to remove PMVector>>sumand it run much faster. The tests are all green.
I think we can remove it.

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

Successfully merging a pull request may close this issue.

2 participants