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

Optimize text comparison for text MIME data #400

Merged
merged 4 commits into from
Jun 25, 2018

Conversation

vidartf
Copy link
Collaborator

@vidartf vidartf commented Jun 20, 2018

Supersedes #237.

Difflib's ratio() method blows up for very large contents. This PR limits this problem for output comparison by giving a maximum length for text data when doing mimedata comparison. If both sides of the comparison are larger than this length, it will revert to strict equality instead of the slow ratio() method.

Difflib's ratio() method blows up for very large contents. We limit this
problem for output comparison by giving a maximum length for text data
when doing mimedata comparison.
@vidartf
Copy link
Collaborator Author

vidartf commented Jun 20, 2018

TODO:

  • Autogenerate a notebook pair with big text data output to compare, and write some regression tests for it.

Uses random data to ensure large edit strings.
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.

1 participant