jpavel2
Joined 12 years ago
Karma
31
Submissions
8
Member since
Apr 14
Joined 12 years ago
#!/bin/bash
declare -A map1=([x]=2)
echo "1. Global scope map1[x]: ${map1[x]}"
func1() {
echo " * Enter func1"
local -A map1
map1[x]=3
echo " Local scope map1[x]: ${map1[x]}"
}
func1
echo "2. Global scope map1[x]: ${map1[x]}"
outputting 1. Global scope map1[x]: 2
* Enter func1
Local scope map1[x]: 3
2. Global scope map1[x]: 2On this low-end Chromebook (Samsung Chromebook 3 with a Celeron N3060 @1.60GHz) I can start the JVM, load the classes for my CLI program, and print a help message,
jpavel@penguin:~$ time rcr -h
Usage: RCloner <config path> get|put <entry> [args]
RCloner <config path> list
real 0m0.316s
user 0m0.208s
sys 0m0.126s
in less than 1/3 of a second. And this is with stock openjdk version 1.8.0_302, which doesn't include the startup time improvements of Java 10 & 12.Sure, I wouldn't write utilities meant to be piped one into another, but for standalone CLI tools, the JVM startup time isn't prohibitive at all.
mathup's tiny, clean API makes it easy to integrate the project in all sorts of processing workflows, both in-browser and scripting.