Skip to content

fix accumda() so it does less recursion and more iteration#12455

Merged
dlang-bot merged 1 commit intodlang:masterfrom
WalterBright:aewalk
Apr 20, 2021
Merged

fix accumda() so it does less recursion and more iteration#12455
dlang-bot merged 1 commit intodlang:masterfrom
WalterBright:aewalk

Conversation

@WalterBright
Copy link
Member

Based on @ibuclaw 's observation https://issues.dlang.org/show_bug.cgi?id=6401#c4 that accumda was doing too much recursion.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#12455"

@ibuclaw
Copy link
Member

ibuclaw commented Apr 20, 2021

Are benchmarks being done between each change? Can results be posted with each of these commits so we know what kind of effect it has?

@WalterBright
Copy link
Member Author

This one just does some tail recursion instead of recursing. It uses less stack, which is faster. It's a commonplace optimization.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments