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
68
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
93
あなたの知らないバージョン命名規則
sat
PRO
3
900
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
64
Machine Check Exception
sat
PRO
2
66
バイナリダンプの模様を読む
sat
PRO
0
89
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
88
114-ファイルのshallow_copy.pdf
sat
PRO
2
57
113-Btrfsのスナップショット.pdf
sat
PRO
0
40
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Chasing Engaging Ingredients in Design
codingconduct
0
310
Are puppies a ranking factor?
jonoalderson
2
3.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Utilizing Notion as your number one productivity tool
mfonobong
4
590
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
720
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
700
Deep Space Network (abreviated)
tonyrice
0
310
Rails Girls Zürich Keynote
gr2m
96
14k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
550
Testing 201, or: Great Expectations
jmmastey
46
8.3k
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使用時間がわかる • 横で別プロセスが動いていると結果が変わるので性能測定時は要注意 • 並行プログラミングによって性能向上できるかも