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

allocate iteration structures lazily #15006

Merged
merged 1 commit into from Mar 14, 2017
Merged

Conversation

stefanpenner
Copy link
Member

@stefanpenner stefanpenner commented Mar 13, 2017

Many times when we go through these functions, we never need to alloc the seen or calls arrays

@krisselden r?

@krisselden
Copy link
Contributor

looks good, though this whole area could use some more testing.

@rwjblue rwjblue merged commit dfbd82b into master Mar 14, 2017
@rwjblue rwjblue deleted the lazy-iteration-structures branch March 14, 2017 00:59
@stefanpenner
Copy link
Member Author

Benchmarks for this guy:

meta forEachIn
testing
- new (empty)
- old (empty)
- new (notEmpty)
- old (notEmpty)
running first test, please wait...
  new (empty) ...... 57,116,740.98 op/s
  old (empty) ...... 13,495,844.67 op/s
  new (notEmpty) .... 2,384,559.17 op/s
  old (notEmpty) .... 2,346,057.37 op/s

For empty traversals (extremely common) we are now 4.3x faster and non empty traversals are about the same.

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.

None yet

3 participants