realestate-com-au / stackup

a simple CLI and Ruby API for AWS CloudFormation
MIT License
97 stars 34 forks source link

GEM CLI very slow in 1.3.1 #60

Closed diist closed 6 years ago

diist commented 6 years ago

I've updated my gems and now stackup v1.3.1 takes 30s to do anything on the command line. While it's "loading" I've got a ruby CPU thread at 100%. Same behaviour with other tools using that gem (shipper, swa).

$ time stackup --version
stackup v1.3.1
stackup --version  21.88s user 3.98s system 98% cpu 26.254 total

$ gem uninstall stackup
Successfully uninstalled stackup-1.3.1

$ gem install stackup -v "1.3.0"
Successfully installed stackup-1.3.0

$ time stackup --version
stackup v1.3.0
stackup --version  0.35s user 0.09s system 93% cpu 0.472 total
mbelekar commented 6 years ago

@diist I get the same percentage of cpu with older versions of stackup. It hits 97% cpu eventually no matter what version of stackup is being used.

➜  ~ time stackup --version
stackup v1.3.1
stackup --version  0.86s user 0.52s system 87% cpu 1.573 total

** Ran it again **
➜  ~ time stackup --version
stackup v1.3.1
stackup --version  0.78s user 0.44s system 97% cpu 1.252 total

** One more time **
➜  ~ time stackup --version
stackup v1.3.1
stackup --version  0.78s user 0.44s system 97% cpu 1.252 total

** Uninstalled 1.3.1 **
➜  ~ gem uninstall stackup
Successfully uninstalled stackup-1.3.1

** Installed 1.3.0 **
➜  ~ gem install stackup -v "1.3.0"
➜  ~ time stackup --version
stackup v1.3.0
stackup --version  0.48s user 0.15s system 90% cpu 0.693 total

** Ran it again **
➜  ~ time stackup --version
stackup v1.3.0
stackup --version  0.42s user 0.12s system 97% cpu 0.552 total

** Uninstalled 1.3.0 **
➜  ~ gem uninstall stackup
Successfully uninstalled stackup-1.3.0

** Installed version 1.2.0 **
➜  ~ gem install stackup -v "1.2.0"
➜  ~ time stackup --version
stackup v1.2.0
stackup --version  0.42s user 0.12s system 97% cpu 0.555 total
diist commented 6 years ago

Oh I wasn't referring to the CPU usage returned by time. What I meant is during the 26.254s it takes to load I can see a ruby thread going nuts using top in another terminal. You don't seem to have that issue even though 1.3.1 seems to take twice as long to load for you.

tigris commented 6 years ago

G'day @diist - can you share what version of ruby you have, and what OS you are on?

diist commented 6 years ago

Currently I'm experiencing the issue with Ruby 2.3.1p112 on macOS Sierra 10.12.6

tigris commented 6 years ago

I wonder if this might be related?

https://github.com/aws/aws-sdk-ruby/issues/1811

diist commented 6 years ago

That's probably it, a gem uninstall --all --force "fixed" it! I'm down to 0.5s now.

Surely stackup doesn't need all of the 150 aws-sdk-* gems?

mdub commented 6 years ago

Yeah, I'd be a good idea to get more specific about the gems stackup uses:

diist commented 6 years ago

Could you release a new version? The issue is back for me and uninstalling all the gems doesn't do the trick anymore 😢 . Note that my hard drive is super slow and might be dying.

mdub commented 5 years ago

I've released 1.4.0, @diist.