Grokking Operating Systems and Networking for Backend Engineers
0% completed
Profiling With perf and eBPF Tools
Checkout handled 121 orders per second, and each one took about 32 ms. The CPU was busy the whole time, and nothing in the code looked slow. A ten-second profile then produced this line:
Output:
92.44% 0.00% [.] py::find_product:checkout.py - -
Ninety-two percent of Checkout's CPU time was spent inside one small function that looked up a product. The function scanned a list of 200,000 products from the start for every order:
for entry in CATALOG: if entry["sku"] == sku: return entry
`strace
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%