From 27b90bed223c554e7d3ac5a1cde810c18bdbeeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 2 Jan 2019 21:52:24 +0100 Subject: [PATCH] Line profiler --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fd4506d..41eeb19 100644 --- a/README.md +++ b/README.md @@ -1413,8 +1413,8 @@ timeit('"-".join(str(a) for a in range(100))', # $ pip3 install line_profiler @profile def main(): - a = [(i%3 + 1) * 3 for i in range(10000)] - b = [i ** (i/10000) for i in range(10000)] + a = [*range(10000)] + b = {*range(10000)} main() ``` @@ -1424,8 +1424,8 @@ Line # Hits Time Per Hit % Time Line Contents ============================================================== 1 @profile 2 def main(): - 3 1 6196.0 6196.0 53.2 a = [(i%3 + 1) * 3 for i in range(10000)] - 4 1 5455.0 5455.0 46.8 b = [i ** (i/10000) for i in range(10000)] + 3 1 1128.0 1128.0 27.4 a = [*range(10000)] + 4 1 2994.0 2994.0 72.6 b = {*range(10000)} ``` ### Call Graph