Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6393

groovysh: suggest reducing startup time by loading commands from code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.0-rc-1
    • 2.3.0-beta-1
    • Groovysh
    • None

    Description

      For undocumented reasons, groovysh uses an xml file to specify the commands to load into the shell, commands being "help", "history", etc. as presented here:
      http://groovy.codehaus.org/Groovy+Shell#GroovyShell-RecognizedCommands

      The xml file just lists the fully qualified Classname, which is then used to create instances of the classes. This happens in

      org/codehaus/groovy/tools/shell/util/XmlCommandRegistrar.groovy

      which is invoked as default command registrar in

      org/codehaus/groovy/tools/shell/Groovysh.groovy

      I fail to see any practical benefit to this, either right now or in theory. However doing so delays groovysh startup. On my machine it feels like I can get a 500ms decrease on my 4s total groovysh startup time by loading the commands from the code.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            tkruse Thibault Kruse
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: