Why so slow?
Posted: Sun Dec 05, 2010 6:28 pm
First of all I would like to say I love cobra specially as it has the pythonic feeling and the static typing good parts and I think since most of the source on http://shootout.alioth.debian.org/ is open source, we need volunteers to write the code for various benchmarks to give the language visibility. I could have done that, but didn't partly due to shortage and partly due to the demotivation by the performance. See below.
I ported the nbody program in python to cobra. But I have to say that either I don't know what I am doing or otherwise I am totally disappointed by cobra's performance. It does not perform even as well as python. I believe the real motivation for Cobra is it's speed over python, there are excellent other factors like no null values, but this is the predominant one.
The cobra program took 150 times (55sec to pythons .3 sec for n=10000) the time taken by the python code, now that is demotivating, I just have one dynamic clause in there, to simplify things, but I still expected it to be close to python at least.
Please tell me what I am doing wrong.
I am attaching both the sources.
Thanks and Regards,
Jai Sharma
I ported the nbody program in python to cobra. But I have to say that either I don't know what I am doing or otherwise I am totally disappointed by cobra's performance. It does not perform even as well as python. I believe the real motivation for Cobra is it's speed over python, there are excellent other factors like no null values, but this is the predominant one.
The cobra program took 150 times (55sec to pythons .3 sec for n=10000) the time taken by the python code, now that is demotivating, I just have one dynamic clause in there, to simplify things, but I still expected it to be close to python at least.
Please tell me what I am doing wrong.
I am attaching both the sources.
Thanks and Regards,
Jai Sharma