473,378 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

IronPython faster than CPython?

I learned a lot from the other thread 'Is a "real" C-Python possible?' about
Python performance and optimization. I'm almost convinced that Python's
performance is pretty good for this dynamic language although there are
areas to improve, until I read some articles that say IronPython is a few
times faster. I find it amazing that something that's written in C and runs
on hardware is slower than a .NET app that runs on CLR as managed code:

http://www.python.org/~jeremy/weblog/031209a.html
http://blogs.msdn.com/jasonmatusow/a...28/402940.aspx
Dec 18 '07 #1
3 2357
On Dec 19, 9:18 am, "Jack" <nos...@invalid.comwrote:
I learned a lot from the other thread 'Is a "real" C-Python possible?' about
Python performance and optimization. I'm almost convinced that Python's
performance is pretty good for this dynamic language although there are
areas to improve, until I read some articles that say IronPython is a few
times faster. I find it amazing that something that's written in C and runs
on hardware is slower than a .NET app that runs on CLR as managed code:

http://www.python.org/~jeremy/weblog/031209a.html
Four years old. IP 0.1 vs CP 2.3. Sheesh.
http://blogs.msdn.com/jasonmatusow/a...28/402940.aspx
Close to 3 years old but somewhat more meaningful ...

"""IronPython 0.7 is up to 1.8x faster than Python-2.4 on the standard
pystone benchmark. The key to IronPython's performance is that it
compiles Python code to .NET Intermediary Language which is then
translated to optimized machine code by the runtime."""

Where did you get "a few times faster" from?
Dec 18 '07 #2
In article <AK******************************@comcast.com>,
"Jack" <no****@invalid.comwrote:
I learned a lot from the other thread 'Is a "real" C-Python possible?' about
Python performance and optimization. I'm almost convinced that Python's
performance is pretty good for this dynamic language although there are
areas to improve, until I read some articles that say IronPython is a few
times faster. I find it amazing that something that's written in C and runs
on hardware is slower than a .NET app that runs on CLR as managed code:

http://www.python.org/~jeremy/weblog/031209a.html
http://blogs.msdn.com/jasonmatusow/a...28/402940.aspx
You might argue that Python programs executed using CPython "run on
hardware" to a *lesser* extent than they do when run in IronPython. In
either case, your program is parsed and compiled into bytecode (Python
bytecode or MSIL), then loaded by the Python virtual machine or the .NET
VM, respectively. But whereas the Python VM is a bytecode interpreter,
the .NET VM, like Java, uses just-in-time compilation to translate MSIL
bytecode to optimized machine code for more efficient execution. This
is probably the most important factor in the performance difference
demonstrated in the above links.

The fact that the IronPython compiler is written in C# and therefore
runs from the VM, whereas the CPython compiler is compiled straight to
machine code, is unimportant. Even if a significant performance
difference did result from this, keep in mind that the bulk of the
execution time of any Python app worth profiling is going to be after
this initial Python-to-bytecode compilation, during the execution of the
program's bytecode itself.

--
Mark Shroyer
http://markshroyer.com/contact/
Dec 18 '07 #3
Jack <no****@invalid.comwrote:
>I learned a lot from the other thread 'Is a "real" C-Python possible?' about
Python performance and optimization. I'm almost convinced that Python's
performance is pretty good for this dynamic language although there are
areas to improve, until I read some articles that say IronPython is a few
times faster.
In my limitted experience, IronPython is slower than CPython. I can't
actually get much to run with IronPython, but what I have been able
to get working runs slower. In particular initialization time takes
much longer. A command line utility of mine that takes 1.5 seconds to
run with CPython, ends up taking 20 seconds with IronPython. That 3
seconds for IronPython's own startup and initilization, 12 seconds for
importing modules, and 5 seconds for the rest.

Ross Ridge

--
l/ // Ross Ridge -- The Great HTMU
[oo][oo] rr****@csclub.uwaterloo.ca
-()-/()/ http://www.csclub.uwaterloo.ca/~rridge/
db //
Dec 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ajay | last post by:
hi! Is it possible for me to have part of my application written using C#.NET and then have it called from within a Python program. thanks cheers
8
by: John Salerno | last post by:
Hi all. I'm currently learning C#, and I'm also interested in learning Python (all of this just for fun, mind you), so it seems like a decent idea to want to integrate the two. But I don't quite...
3
by: Carl Johan Rehn | last post by:
What is the difference between CPython, Python for .NET, and IronPython? For example, if I'm running IronPython, can I access modules such as Numeric and numarray? As I understand it,...
3
by: Sanghyeon Seo | last post by:
I took some time to write this HOWTO: http://sparcs.kaist.ac.kr/~tinuviel/fepy/howto/simplehttpserver-ironpython-mono-howto.html IronPython seems to get much less interest than it deserves. This...
9
by: Luis M. González | last post by:
Check it out: http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742
2
by: tkpmep | last post by:
I'm looking forward to the release IronPython, primarily for its IDE. I currently use scipy and pyExcelerator to crunch numbers and write them to Excel: does can these packages be used with...
9
by: Claudio Grondi | last post by:
(just wanted to share my experience with IronPython 1.0) The context: C:\IronPythonipy.exe IronPython 1.0.60816 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved....
22
by: dmitrey | last post by:
Hi all, the url http://torquedev.blogspot.com/2008/02/changes-in-air.html (blog of a game developers) says IronPython is faster than CPython in 1.6 times. Is it really true? If yes, what are...
1
by: jmDesktop | last post by:
I know that IronPython and CPython are different in that one does not use the .net framework, but are they both really the same Python language. From my basic understanding, it will depend on what...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.