Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
timeコマンド
Search
Satoru Takeuchi
PRO
June 22, 2022
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
timeコマンド
以下動画のテキストです
https://youtu.be/_3ABqhVtV4I
Satoru Takeuchi
PRO
June 22, 2022
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
59
Machine Check Exception
sat
PRO
2
54
バイナリダンプの模様を読む
sat
PRO
0
74
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
62
114-ファイルのshallow_copy.pdf
sat
PRO
2
45
113-Btrfsのスナップショット.pdf
sat
PRO
0
28
システム強制終了時にファイルシステムの整合性を保つ~ コピーオンライト編 ~
sat
PRO
0
66
システム強制終了時に ファイルシステムの整合性を保つ ~ ジャーナリング編 ~
sat
PRO
2
72
ファイルシステムの整合性を回復するfsck
sat
PRO
1
78
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
11
39k
Technical Leadership for Architectural Decision Making
baasie
3
510
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
550
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
How to build a perfect <img>
jonoalderson
1
5.9k
Transcript
timeコマンド Jun. 19th, 2022 Satoru Takeuchi twitter: satoru_takeuchi
timeコマンド • 引数に与えたコマンドを実行し、CPU使用時間や終了までの所要時間を出力 • 出力の意味 ◦ real: コマンドの実行開始から終了までの所要時間 ◦ user:
コマンド実行中にプロセスが使用した CPU時間 ◦ sys: コマンド実行中に、そのコマンドのためにカーネルが使用した CPU時間
例: 一定時間CPUを使い続けた後に終了 プロセス CPU上で動 作する処理 時間 real user 開始 終了
例: 一定時間システムコールを呼び続けた後に終了 プロセス CPU上で動 作する処理 時間 real user = (a)+(c)+(e)
開始 終了 カーネル プロセス カーネル プロセス (a) (c) (e) (b) (d) sys = (b)+(d)
例: 一定時間CPUを使い続けた後に終了(別プロセスあり) プロセス CPU上で動 作する処理 時間 real user = (a)+(b)+(c)
開始 終了 別プロセス プロセス 別プロセス プロセス (a) (b) (c)
例: 起動直後に寝て起きたらすぐ終了 CPU上で動 作する処理 時間 real user = (a) +
(b) 開始 終了 アイドル (a) (b)
例: 複数コア上で一定時間CPUを使った後に終了 プロセス CPU0上で動作 する処理 時間 real user = (a)
+ (b) 開始 終了 CPU1上で動作 する処理 プロセス 生成 終了 (a) (b)
まとめ • timeコマンドはプロセスの所要時間と、その間のCPU使用時間がわかる • 横で別プロセスが動いていると結果が変わるので性能測定時は要注意 • 並行プログラミングによって性能向上できるかも