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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monkey patch configparser with EfficientParsingError #144

Merged
merged 1 commit into from
Mar 21, 2019

Conversation

KevinHock
Copy link
Collaborator

@KevinHock KevinHock commented Mar 21, 2019

This hopes to provide a short-term solution for #136

Changes

馃幁 馃幁 馃幁

  1. Subclass configparser.ParsingError
  2. Overwrite the terribly inefficient append method
  3. Monkey patch ParsingError with EfficientParsingError

Testing

I ran this on the "take forever" ~250k line file with time and it took around 11 seconds, we should probably do solutions 1 or 3 from our discussion as well, eventually, but taking 11 seconds vs. forever is incrementally better.

Subclass `configparser.ParsingError`, overwrite the
terribly inefficient `append` method and monkey patch
`ParsingError` with `EfficientParsingError`
@KevinHock KevinHock requested a review from domanchi March 21, 2019 18:34
Copy link
Contributor

@domanchi domanchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@KevinHock KevinHock merged commit 3c9c6c4 into master Mar 21, 2019
@KevinHock KevinHock deleted the 136_improve_ini_perf branch March 21, 2019 22:03
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

2 participants