are inter preted programs slower and is python interpreted
are interpreted programs slower and is python interpreted
or let me put it this way is python application slower than other compled languages bcos i feel yum is slower than apt |
Python is interpreted and as such will run slower than a compiled source.
|
sort of by definition but not neccecelery in practice.
It depends on lots of things, how well programmed it is for a start. I have found (with perl) that it will run as near as dammit as fast as C. In fact, I found C was faster only when I didn't put safety checks in on file reads and what not, which perl has automatically. |
You can't beat assembly language when the unique metric is speed.
However, ease of development, portability, readability, maintainability, debuggability, developer skills are other elements that usually balance the choice toward other languages, like C, C++, Java, PHP, Python and the likes. |
thanx alot
|
Quote:
|
Quote:
You could always hand-tweak a compiler-generated assembly file ;). |
Quote:
Quote:
And so do good assembler programmers. They read the processor manuals continually, learn their hardware, and test to see what works best. If, on the other hand we're comparing the output of a good optimizing compiler to the output of a mediocre assembler programmer, the outcome shouldn't surprise anybody. Quote:
|
any language and api are there for a purpose , i think the slowness or the "intensity" of any things are not that important ... they usually serve the long-term purpose well enough ... its silly enough for a windows user to ask for a complete set of commandline flexibilities while linux is able to have complete set of both worlds , sometimes i would like to think that stuffs like these are really actually build for the linux world ...
:twocents: . |
In the most literal sense, compiled code is faster than interpreted code (or byte code compiled code, like java), however, there are many other factors which affect the execution speed - Hard disk usage, communication with external hardware (eg, via serial cable) and network communication. On most programs, except perhaps for some very computation heavy projects (eg, scientific research, brute force algorithms, etc) are going to spend more time waiting for the HDD or network than waiting for the CPU to work.
|
Compilers generate assembly? Wow, this is a new one. I was under the impression that one wrote code in assembly (which is human readable) and then it was compiled into machine language. Sorry, I just had to pick that nit! :)
Seriously though - more than anything else it's the architecture and implementation that will affect performance. You can write really sloppy assembly and clean C, and the C can vastly outperform the sloppy assembly routine. YMMV, batteries not included, etc. |
Quote:
Quote:
|
Quote:
(Ah, this "philosiphising" is a nice break from cold hard technical problems!;) ) |
what is this assembly code you speak of.. is that something like visual basic?
|
Quote:
|
Back to the subject, it can easily be proved than you cannot write a program in an higher level language that will outperform its assembly language competitor, assuming the development effort is not an issue.
Of course this is meaningless, as the development effort is always an issue. Consequently assembly language is today a very specialized domain, largely because of the C language flexibility. |
To sum up what everyone has posted.
Assembly language is the human readable notation for CPU instructions and machine language basicaly is the assembly language converted to numeric form. The assembler is the program that converts the human notation into machine language. And yes it is the function of the compiler to convert a high level language into assembly language, from assembly to machine code and then linking which is the process of creating an executable program. http://en.wikipedia.org/wiki/Assembly_language |
Quote:
i cant claim that assembly is easier for me to read, but it is definately preferred.. and to throw in something worthwhile.. i have several books on assembly, and most of the authors seem to suggest that tweaking compiler generated code will get you more performance if you know where to look in the code and know what you are doing. however, in practical use, you still have a bottleneck of file access, network useage, and printing to console/gui to contend with. you have to look at the efficiency of your efficiency efforts.. |
All times are GMT -5. The time now is 06:35 AM. |