Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Faster code execution with Numba and Numpy #13

Closed
wants to merge 1 commit into from
Closed

Faster code execution with Numba and Numpy #13

wants to merge 1 commit into from

Conversation

diegocaro
Copy link

Hi all, I have been playing with drawing from noise using opensimplex. Sadly, is too slow if you want to compute a large picture, or a long animation.
Here I propose a patch to use the Numba jit and numpy. There are few lines changed and the improvement is very promising with a 75% speed improvement (from ~270msec to ~68msec in the benchmark below).

Old code benchmark:

PYTHONPATH=opensimplex/ python3 -m timeit 'from opensimplex import OpenSimplex; s=OpenSimplex(seed=0);
[s.noise2d(0.1, 0.1) for n in range(100000)]'
1 loop, best of 5: 278 msec per loop

Patched code benchmark:

PYTHONPATH=opensimplex/ python3 -m timeit 'from opensimplex import OpenSimplex; s=OpenSimplex(seed=0);
[s.noise2d(0.1, 0.1) for n in range(100000)]'
1 loop, best of 5: 68.7 msec per loop

Cheers from Chile!

@lmas
Copy link
Owner

lmas commented Jul 19, 2020

Hello and thanks for your request!

Appreciate your work but unfortunately I'll have to say no, just as I've said before to others. Please see the open issue #4

@lmas lmas closed this Jul 19, 2020
@lmas lmas added the duplicate label Jul 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants