Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.2.0-rc-1
-
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.