D
Deep_Feelings
thank you very much ,your reply guys are very nice and informative.
hope you best luck in your life
hope you best luck in your life
That only applies to CPU bound program code (most program code is I/O
bound), and only to computational bottlenecks (usually less than 5% of
the code) in the CPU bound programs. Today, most programs are I/O
bound: You don't get a faster network connection or harddrive by using
C. In this case, performance depends on other factors than choice of
language. That is why Mercurial (written in Python) can be much faster
than SVN (written in C).
For computational bottlenecks we might want to try high-performance
numerical libraries first. If that does not help, we can try to
replace some Python with C.
I'd also include that a change in algorithm can be a big help for
speeding up CPU-bound code. It doesn't matter much if you're using
Python or hand-coding that inner loop in C/ASM, if you're using a
O(2^N) algorithm.
That only applies to CPU bound program code (most program code is I/O
bound), and only to computational bottlenecks (usually less than 5% of
the code) in the CPU bound programs. Today, most programs are I/O
bound: You don't get a faster network connection or harddrive by using
C. In this case, performance depends on other factors than choice of
language. That is why Mercurial (written in Python) can be much faster
than SVN (written in C).
For computational bottlenecks we might want to try high-performance
numerical libraries first. If that does not help, we can try to
replace some Python with C. Python as "glue" does not mean Python is
inferior to C. It just means it is a PITA to write C or Fortran all
the time. I value my own time a lot more than a few extra CPU cycles.
Who cares about speed where it is not needed?
doubting python's speed?
> Look at Mercurial vs. SVN;
Mercurial is written in Python while SVN in C.
> Mercurial beats SVN in speed by several orders
of magnitude.
One of Mercurial's design goal was to be faster than SVN, if the
programmers have naively believed that choice of language would matter
to program's speed, they'd choose to write Mercurial in assembly instead
(the same argument applies to Git, written in shell scripts).
Now, you may think this is an unfair comparison, since Mercurial is hype
and new, SVN is antiquated and old. But it shows that in real-life, the
language being inherently slow often dosn't matter. What matters more
are the choice of data structure and algorithm, I/O speed, network
latency, and development speed.
Because, as I said, and as you explain further, Python favors programmer
speed, including speed of testing new algorithms, over raw execution
speed of current algorithms. (Current) speed is (also) easier to test
than improvability and hence possible speed improvements.
If and when mercurial deveopment slows down, some of its developers
might consider whether any of the utility functions written in Python
might usefully be rewritten in C. One of the intentional virtues of
Python is that one can transparently convert part or all of a module
*without changing* the import and use of the module.
Erm, in fairness, I recall hearing that some speed-critical bits of hg
are written in C. It does lend credence to the "Python as glue
language" argument though; I doubt hg's extensibility and friendly
interface would have been as easy to implement it C (particularly the
slick instant-server feature).
There are a lot of commercial programs written in Python. But any
company which thinks it has a lock on some kind of super secret sauce
isn't going to use Python,
Deep_Feelings said:i will be interested more in COMMERCIAL programs written in python
The is a somewhat bizarre response to me. I have been promoting Python
for about 13 years, since I dubbed it 'executable pseudocode', which is
to say, easy to write, read, understand, and improve. I am also a
realist. Any fixed (C)Python program can be sped up, at least a bit, and
possibly more, by recoding in C. At minimum, the bytecodes can be
replaced by the C code and C-API calls that they get normally get
translated into. Ints can be unboxed. Etcetera. This tend to freeze a
program, which is fine when development is finished.
But the point still hold, that in real life, often the language's raw
speed doesn't really limit the program's speed.
Gregory Ewing said:I came across a game on Big Fish Games recently (it was
"The Moonstone" IIRC) that appeared to have been built using
Python and py2app.
Agree, reveres engineering is crucial issuer for programming
language
but every executable file can be cracked, for example by using
disassembler!!!
For each weapon there is antiweapon, so
is it possible to prevent reveres engineering when customer have
access to executable made from Python code???
is it possible to prevent reveres engineering when customer have access
to executable made from Python code???
No. But you can make it hard.
Store a GPG encrypted blob in your program that contains you secret
sauce, is decrypted to memory, executed, and then discarded. Setup
some kind of license manager like dongle or application to perform the
key management.
That merely gives a false sense of security. If the program is decrypted
in memory, you can easily make a memory dump to get the unencrypted
program. If I am a competitor that can make economic advantage by
cracking your secret sauce, it wouldn't be difficult for me to do that.
Yes, in fact the only people inconvenienced are your paying clients.
That merely gives a false sense of security.
If the program is decrypted
in memory, you can easily make a memory dump
to get the unencrypted
program. If I am a competitor that can make economic advantage by
cracking your secret sauce, it wouldn't be difficult for me to do that.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.