How about benchmarking the python code with NumPy?
My understanding is that you have to rewrite your code to take advantage of NumPy. Unfortunately, I've never used NumPy before, so I don't know how to do so. However, if you'd like to modify my code to do so I'd be happy to rerun the test and publish the results.
Make Lisp 15x faster than Python or 4x faster than Java
31–40 of 100 posts
Re: Make Lisp 15x faster than Python or 4x faster than Java
#32> All the benchmarks were run 5x each on the same Debian machine I refer the honourable gentlman to Zed Shaw's "Programmers Need To Learn Statistics Or I Will Kill Them All" http://www.zedshaw.com/essays/programmer_stats.html
I'm actually a mathematician by training ;-) I ran all tests 5 times each, and averaged the results. Each of the results for each of the tests were within 2% of each other, and the machine wasn't used for anything else while the tests were running. I know it's not perfect, but I don't see any obvious sources of error ... I did provide all the source, so you're welcome to verify my results.
Re: Make Lisp 15x faster than Python or 4x faster than Java
#33Earlier quoted context omitted.
My understanding is that you have to rewrite your code to take advantage of NumPy. Unfortunately, I've never used NumPy before, so I don't know how to do so. However, if you'd like to modify my code to do so I'd be happy to rerun the test and publish the results.
[deleted]
If you care to do so, I'll be happy to include the results.
Re: Make Lisp 15x faster than Python or 4x faster than Java
#34Re: Make Lisp 15x faster than Python or 4x faster than Java
#35Are people still calling Lisp slow in 2010? That was somewhat true when most programming was done in C. Plenty of languages slower than Lisp have risen to popularity since then.
http://shootout.alioth.debian.org/u32/benchmark.php?test=all...
One of the guys behind R is also looking at moving to a LISP base after considering python:
http://www.springerlink.com/content/v38u176xp7j562m3/
That said, I will stick with python as I am not a programmer by profession and can't deal with a plethora of languages when I have a good swiss army knife as it is.
Re: Make Lisp 15x faster than Python or 4x faster than Java
#36Is java known to be (about) 4x faster than python?
http://shootout.alioth.debian.org/u32q/benchmark.php?test=al...
Roughly speaking, anything time-critical needs to be done in c.
Re: Make Lisp 15x faster than Python or 4x faster than Java
#37Is java known to be (about) 4x faster than python?
4x is low: http://shootout.alioth.debian.org/u32q/benchmark.php?test=al... Roughly speaking, anything time-critical needs to be done in c.
Re: Make Lisp 15x faster than Python or 4x faster than Java
#38Re: Make Lisp 15x faster than Python or 4x faster than Java
#39 local radius = 6371
local function distance(latA, lngA, latB, lngB)
local latAr = math.rad(latA)
local lngAr = math.rad(lngA)
local latBr = math.rad(latB)
local lngBr = math.rad(lngB)
local deltaLat = latBr - latAr
local deltaLng = lngBr - lngAr
return radius * 2 * math.asin(math.sqrt(
math.sin(deltaLat/2)^2 + math.cos(latAr)
* math.cos(latBr) * (math.sin(deltaLng/2)^2)))
end
local start = os.clock()
for latA=-90,90,2.5 do
for lngA=-90,90,2.5 do
for latB=-90,90,2.5 do
for lngB=-90,90,2.5 do
distance(latA, lngA, latB, lngB)
end
end
end
end
local stop = os.clock()
print(stop-start)Re: Make Lisp 15x faster than Python or 4x faster than Java
#40> All the benchmarks were run 5x each on the same Debian machine I refer the honourable gentlman to Zed Shaw's "Programmers Need To Learn Statistics Or I Will Kill Them All" http://www.zedshaw.com/essays/programmer_stats.html
I'm actually a mathematician by training ;-) I ran all tests 5 times each, and averaged the results. Each of the results for each of the tests were within 2% of each other, and the machine wasn't used for anything else while the tests were running. I know it's not perfect, but I don't see any obvious sources of error ... I did provide all the source, so you're welcome to verify my results.