Java vs Python Benchmarks: Java is faster
Ype Kingma
ykingma at accessforall.nl
Mon Feb 4 14:12:38 EST 2002
Jason,
you wrote:
>
<snip>
>
> I guess I imagine that Python's speed issues are:
>
> 1. Ultra-late binding of, and consequent repetitive lookups of,
> global names, attributes, methods, module members, etc.
> (Of course, unless names like 'int' and 'float' can be bound
> at compile time, optional type declarations are unhelpful.)
>
> Since many people like this about Python, and many have used it
> in existing code, effort is focused on making lookups cheaper
> (or caching the results) rather than changing the binding
> behavior to require fewer lookups overall.
>
> 2. Nothing ever gets compiled to anything even close to
> machine code. This is largely because the Python development
> team doesn't have the resources to invest in it. Clearly
> there's something to gain by moving the huge ceval.c loop/switch
> from runtime to compile time. No one knows how much. Clearly
> there's something to lose from the resulting explosion in the
> complexity of the compiler.
>
Please note that jython is compiled directly to Java opcodes.
Anything that makes interpreting these faster (JIT, native compilation)
will make jython faster.
Regards,
Ype
More information about the Python-list
mailing list