Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
70
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
95
あなたの知らないバージョン命名規則
sat
PRO
3
910
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
64
Machine Check Exception
sat
PRO
2
67
バイナリダンプの模様を読む
sat
PRO
0
91
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
89
114-ファイルのshallow_copy.pdf
sat
PRO
2
58
113-Btrfsのスナップショット.pdf
sat
PRO
0
41
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
How to make the Groovebox
asonas
2
2.5k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
540
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
How to build a perfect <img>
jonoalderson
1
6k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
540
Facilitating Awesome Meetings
lara
57
7.1k
Making Projects Easy
brettharned
120
6.8k
Evolving SEO for Evolving Search Engines
ryanjones
0
300
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使用時間がわかる • 横で別プロセスが動いていると結果が変わるので性能測定時は要注意 • 並行プログラミングによって性能向上できるかも