Project

General

Profile

Bug #6761

Slow hammer startup times (1.3+ seconds)

Added by Dominic Cleal over 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:
Red Hat JIRA:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1122810
Description of problem:
When running "hammer --help", it's taking in excess of 1.3 seconds. This makes it inefficient for use in a shell script, particularly when needing to retrieve IDs or run checks in other commands.

Version-Release number of selected component (if applicable):
rubygem-hammer_cli-0.1.1-5.el6sat
rubygem-hammer_cli_foreman-0.1.1-9.el6sat

How reproducible:
Always

Steps to Reproduce:
1. time hammer --help
2.
3.

Actual results:

= 1.3 seconds

Expected results:
< 0.5 seconds?

Associated revisions

Revision 4fbd36b4 (diff)
Added by Tomas Strachota over 8 years ago

Fixes #6761 - lazy loaded subcommands

Revision 38372b55
Added by Martin Bacovsky over 8 years ago

Merge pull request #126 from tstrachota/lazy_loading

Fixes #6761 - lazy loaded subcommands

Revision f2bf9992 (diff)
Added by Tomáš Strachota over 8 years ago

Fixes #6761 - lazy loaded subcommands

Revision 8032093f
Added by mbacovsky over 8 years ago

Merge pull request #139 from tstrachota/lazy_loading

Fixes #6761 - lazy loaded subcommands

History

#1 Updated by Dominic Cleal over 8 years ago

  • Category set to Hammer core
  • Priority changed from High to Normal

#2 Updated by Tomáš Strachota over 8 years ago

  • Target version set to 1.7.5

#3 Updated by Tomáš Strachota over 8 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomáš Strachota

#4 Updated by The Foreman Bot over 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/126 added
  • Pull request deleted ()

#5 Updated by Tomáš Strachota over 8 years ago

Most time consuming turned out to be command and option definition that takes place at class level. Lazy loading of subcommands strips most of the unnecessary requires.

My measurements showed times slightly <0.5s for hammer -h (or around 0.8 when running in bundler).

https://github.com/theforeman/hammer-cli/pull/126
https://github.com/theforeman/hammer-cli-foreman/pull/139
https://github.com/Katello/hammer-cli-katello/pull/210

#6 Updated by Anonymous over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF