Ian 的筆電是Dell E6420,具有Intel Core I7-2720QM CPU(2.20 GHz,6 MB快取,四
核心)和8 GB的RAM,執行Ubuntu 13.10。
在
calc_pure_python
(範例2-2)裡,我們可以看到幾個
print
陳述式,這是
在函式裡
量測一段程式碼的執行時間的最簡單方式。這是非常基本的方法,然而,儘管迅速又隨
性,當你剛看到一段程式碼時,那會是非常有用的。
透過效能分析找出瓶頸
|
27
在偵錯程式碼及進行效能分析時,使用
print
陳述式是很平常的,但很快就會變得不好
管理,然而,對簡單的調查來說還是很有用的。當你使用完畢 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.