Created
March 21, 2019 14:32
-
-
Save amad/e2b77d341864c86917f71c4ff06a206e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
import perfplot | |
perfplot.show( | |
setup=lambda n: numpy.random.randint(0, 1000, n), | |
kernels=[ | |
lambda a: a[::-1], | |
lambda a: numpy.ascontiguousarray(a[::-1]), | |
lambda a: numpy.fliplr([a])[0] | |
], | |
labels=['a[::-1]', 'ascontiguousarray(a[::-1])', 'fliplr'], | |
n_range=[2**k for k in range(25)], | |
xlabel='len(a)', | |
logx=True, | |
logy=True, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment