If you want to follow along, check the repository gitlab.com/ariya/nashorn-speedtest. Assuming you have JDK 8 installed properly, run the following:
javac -cp rhino.jar speedtest.java java -cp .:rhino.jar speedtest
This test app will execute Esprima parser and tokenizer on the content of the test file. Rhino gets the first chance, Nashorn follows right after (each engine gets 30 runs). In the beginning, Rhino’s first run is 2607 ms and slowly it speeds up and finally this parsing is completed in just 824 ms. Nashorn timings have a different characteristic. When it is cold, Nashorn initially takes 5328 ms to carry out the operation but it quickly picks up the pace and before you know, it starts moving full steam ahead, reaching 208 ms per run.
Next time you have the urge to herd some rhinos, consider Nashorn!