Hello,

By curiosity, I have translated a simple algorithm from python to julia in 
order to compare their performance (gist here 
<https://gist.github.com/jebej/307cba73c5c1025399d3>). I am still a 
relative newcomer and so am not sure why I am seeing worse performance from 
julia.

The code was not optimized for python (or julia for that matters).

The code generates a Hamiltonian for a 1D transverse field ising model, and 
I am varying the number of sites which makes the size of the matrix grow 
exponentially. Here are the timings I get:

<https://lh3.googleusercontent.com/-Zia04bwFUtM/Vt8829M6VtI/AAAAAAAAFao/MF3HuEhP5w8/s1600/tfimbench.png>

As can be seen, Julia is faster for lower number of sites, but that changes 
at N=13. Also interesting is the CPU and memory use during those runs. It 
seems that Julia uses memory much more aggressively:

<https://lh3.googleusercontent.com/-JkKSGRcoeYY/Vt89OvZr-HI/AAAAAAAAFas/ZgiuJSnNo6Q/s1600/CPUandRAM.PNG>

Reply via email to