Created
April 28, 2020 17:56
-
-
Save susmithagudapati/36749ceeeb9724ec9a2c81f9d026c663 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
# executed by Python | |
%timeit if Product.objects.all(): print("valid") | |
4.19 ms ± 118 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) | |
# executed in the database | |
%timeit Product.objects.exists() | |
226 µs ± 4.73 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment