Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Huge amount of memory used and very slow when parsing many arguments #255

Closed
cecton opened this issue Jan 6, 2020 · 2 comments
Closed

Comments

@cecton
Copy link

cecton commented Jan 6, 2020

We got an new issue here: https://github.com/paritytech/ethabi/issues/161

And upon investigation I found out that docopts.rs was taking a huge amount of memory to process the arguments and it is very slow. When I use enough arguments, it crashed because it used the whole memory of the system.

I managed to make a test case here in hope I could fix it: https://github.com/cecton/docopt.rs/tree/infinite-loop-filling-memory

If you remove the last five or six -p arguments it can complete but it takes more than 40 seconds and used 2.6GB on my machine.

I don't think we will fix this issue in docopt.rs, we think about switching to structopt because it looks rather complicated for me to fix.

@BurntSushi
Copy link
Member

From the README:

This crate is unlikely to see significant future evolution. The primary reason to choose this crate for a new project is if you're specifically interested in using docopt syntax for your project. However, the wider docopt project is mostly unmaintained at this point.

Consider using clap or possibly structopt instead.

Moreover, issues like this have already been filed. For example: #207.

@cecton
Copy link
Author

cecton commented Jan 7, 2020

Thanks! Sorry for the duplicate, I was looking at "memory" issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants