Skip to content

MCMC on Ising Model Comparison with Python, Cython, Numba, Julia #1903

Closed Answered by soraros
jakee417 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @jakee417, thank you for the blog!

I didn't run the profiler but I think this line is allocating like crazy:

    elif exp(-dE * beta) > rand[data_type](1)[0]:

You created a Tensor only to throw it away.

Maybe you could try usingrandom_float64().cast[field.dtype](). It gives an easy 2 times speedup on my machine.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jakee417
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants