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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Satoru Takeuchi
PRO
June 22, 2022
0
130
timeコマンド
以下動画のテキストです
https://youtu.be/_3ABqhVtV4I
Satoru Takeuchi
PRO
June 22, 2022
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
小学校5,6年生向けキャリア教育 大人になるまでの道
sat
PRO
8
3.4k
ファイルシステムの不整合
sat
PRO
2
130
書籍執筆での生成AIの活用
sat
PRO
2
440
ChatGPTに従って体調管理2026
sat
PRO
0
170
eBPF
sat
PRO
1
140
waruiBPF
sat
PRO
0
120
eBPFとwaruiBPF
sat
PRO
5
4.3k
Pythonのコードの気になる行でスタックトレースを出す
sat
PRO
1
110
ソースコードを読むときの思考プロセスの例 ~markdownのレンダリング方法を知りたかった2 markdownパッケージ~
sat
PRO
0
220
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
860
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
180
Are puppies a ranking factor?
jonoalderson
1
3.2k
The SEO Collaboration Effect
kristinabergwall1
0
410
Information Architects: The Missing Link in Design Systems
soysaucechin
0
850
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Balancing Empowerment & Direction
lara
5
990
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Google's AI Overviews - The New Search
badams
0
950
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
340
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使用時間がわかる • 横で別プロセスが動いていると結果が変わるので性能測定時は要注意 • 並行プログラミングによって性能向上できるかも