As a guy who does (mainframe) Performance for a living I'd say that if a language is scripting some underlying capabilities you have to think about two things:
- The capabilities' being scripted speeds. For example Java's JNI usually is doing native stuff that might not be possible to speed up.
- The scripting language and code. So, Javascript in most browsers now has good JIT compilation etc. I've not heard of much effort to speed up Python other than PyPy. (I'd love links to discussions on how Python can be sped up.)
But then there's the algorithm. If you wrote bad code (and what is bad code might be environment-specific) you get what you deserve. :-)