From b8ff7f58a56ab3488ce4dbd3934c8e0412178364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 27 Dec 2022 21:19:52 +0100 Subject: [PATCH 001/471] Profiling --- README.md | 3 +-- index.html | 11 +++++++---- pdf/remove_links.py | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 09b5bfa01..ff57f8698 100644 --- a/README.md +++ b/README.md @@ -2604,9 +2604,7 @@ Line # Hits Time Per Hit % Time Line Contents 2 def main(): 3 1 955.0 955.0 43.7 a = [*range(10000)] 4 1 1231.0 1231.0 56.3 b = {*range(10000)} -``` -```text $ python3 -m memory_profiler test.py Line # Mem usage Increment Line Contents ======================================================= @@ -2627,6 +2625,7 @@ drawer = cg.output.GraphvizOutput(output_file=filename) with cg.PyCallGraph(drawer): ``` +* **The "latest and greatest" profiler that can also monitor GPU usage is called [Scalene](https://github.com/plasma-umass/scalene).** NumPy diff --git a/index.html b/index.html index 66f8afdf8..d23874b14 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -2133,8 +2133,8 @@

Format

$ python3 -m memory_profiler test.py + +$ python3 -m memory_profiler test.py Line # Mem usage Increment Line Contents ======================================================= 1 37.668 MiB 37.668 MiB @profile @@ -2152,6 +2152,9 @@

Format

Scalene. +

#NumPy

Array manipulation mini-language. It can run up to one hundred times faster than the equivalent Python code. An even faster alternative that runs on a GPU is called CuPy.

# $ pip3 install numpy
 import numpy as np
 
@@ -2916,7 +2919,7 @@

Format