Alfresco v4.0.1 is using: rhino-js-1.6R7.jar
According to: https://developer.mozilla.org/en/Rhino_downloads_archive
rhino 1.6r7 is from 2007-08-20 which is four releases behind.
Rhino is a core part of Alfresco (e.g. webscripts). Share is also heavily dependent on Rhino. I suggest an upgrade to take advantage of performance improvements.
Some choice notes from the change-log:
In 1.7R3 (2011-05-09):
"Rhino has seen some performance improvements since the last release which are most notable when running benchmarks or the test suite."
...Admittedly that's just a few days ago.
"Make string concatenation with + fast"
"Faster number to string conversion"
"RegExp performance improvements"
"Improved interpreter performance"
In particular, we noticed that regexp is incredibly slow compared to native Java Regexp.
Performance is crucial to most installations, particularly the cloud implementation, so I gave this a priority of 'Major'.