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

groovysh: suggest reducing startup time by loading commands from code

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-rc-1
    • Fix Version/s: 2.3.0-beta-1
    • Component/s: Groovysh
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: