[Tutor] Sun says: Don't use Java, use Python!
alan.gauld@bt.com
alan.gauld@bt.com
Tue Feb 11 18:53:00 2003
> According to the Python Tutorial, section 6.1.2, ``Compiled'' Python
> files, the only thing faster about a compiled file is the speed with
> which it is loaded. Once loaded, it won't run any faster than the
> regular script version of the program.
Thats true because Python always runs compiled code. However 'loading'
includes the compilation of the code and if its a long file that can be
significant.
If the code comprises an infinite loop (like a server program) then once
running the two forms will be identical. If its a single shot batch
program the 'loading' time of the top script can be significant part
of the total runtime.
So as ever the answer to whether it helps to compile first is "it depends"
Alan G