0

When dealing with a scripting engine, I'd expect them to be fractions slower than code compiled to assembly. What sort of efficiency numbers are there for major scripting languages (if any)?

Or is this a futile question?

Thanks.

Narf the Mouse
  • 1,521
  • 5
  • 17
  • 27
  • 1
    It's impossible to really say. It _really_ depends on what you are doing with the scripting engine and how the code is implemented. – GWW Mar 12 '11 at 05:03
  • 1
    Futile, subjective, the whole lot. Did you know that [Java bytecode is sometimes compiled, and sometimes interpreted](http://stackoverflow.com/questions/2585053/do-jvms-on-desktops-use-jit-compilation)? – Matt Ball Mar 12 '11 at 05:08
  • Yes, *in general*, scripting languages have slower run-time performance than compiled languages. However, there are exceptions. Without more specific information, it's very difficult for anyone to account for those exceptions in their answer. If you can be more specific in your question, please flag a moderator for this question to be re-opened. It's not a bad question per se, just unanswerable at this point. – Cody Gray Mar 12 '11 at 08:23

1 Answers1

1

Go to http://shootout.alioth.debian.org/ for actual numbers.

As you can see, languages that are usually compiled (i.e. C, C++, etc.) destroy interpreted languages in terms of performance (both running time and memory).

But the question is odd.

Any scripting language can be made compilable into native code (i.e. assembly) and vice versa (e.g. HipHop: PHP to C++ compiler).

And language aside, some compilers are much better than others because they know how to optimize the code to run faster natively. And they also differ between single-core and multi-core systems.

So if I can take a guess... if you're making a decision on what language to use based on performance (especially... ESPECIALLY if you're talking about scripting languages), you're probably making a mistake. There are many more considerations beyond performance that impact on selection of a programming language for a project.

If I guessed wrong, sorry!

khoomeister
  • 4,414
  • 4
  • 27
  • 38