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

Use successors #398

Closed
wants to merge 1 commit into from
Closed

Use successors #398

wants to merge 1 commit into from

Conversation

Masynchin
Copy link
Contributor

Use successors instead of hand-made loop.

@QuarticCat I have slightly refactored your changes from #393, can you measure speed up/downgrading?

@Masynchin
Copy link
Contributor Author

@Wilfred it seems that tests doesn't cover Stack::size. For example,

pub fn size(&self) -> usize {
-    successors(self.head.as_ref(), |node| node.next.as_ref()).count()
+    successors(self.head.as_ref(), |node| node.next.as_ref()).count() + 100
}

passes the tests.

@QuarticCat
Copy link
Contributor

QuarticCat commented Oct 3, 2022

Actually, this function was only used in a debug output, which should not have an impact on the performance. And it was removed in #395.

@QuarticCat
Copy link
Contributor

By the way, I am planning the next big performance improvement PR, in which I completely refactored the stack. https://github.com/QuarticCat/difftastic/blob/new-thoughts/src/diff/graph.rs#L126

@Masynchin
Copy link
Contributor Author

And it was removed in #395.

Seems that my PR is no longer relatable :(

@Masynchin Masynchin closed this Oct 3, 2022
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