Learn how to complete the timing challenge from the last video.
(happy music)…- [Instructor] Let's look at the solutions…to the little challenge problem.…I typed in the loop1.sh script.…Notice, I'm using the pwd command,…and we're going to go 50,000 times here.…We want to time it, so we'll just say time ./loop1.sh,…and that took, on this computer, 6/10ths of a second.…
Pretty darn quick.…Let's just check, type pwd, and it's a shell built in.…A shell built in means the shell itself, bash itself,…when it sees pwd, it's just going to do it,…doesn't have to go search for a command with that name…and launch a new process for it, it just does it.…Now, let's edit loop1.sh,…and change the pwd to actually run the command in pwd.…
Just to check, there it is, executable program, so forth.…Let's time it now.…My goodness, took 21.5 seconds, and a lot more CPU time.…Big difference, isn't it?…We had time to get a good drink of coffee there.…Let's now investigate what's going on.…Right now, this script uses bin/pwd,…let's do an strace, counting information,…send the output to /tmp/s.out, and we run the script.…
- Timing techniques
- Packages for performance
- Identifying and optimizing CPU bottlenecks
- Finding memory bottlenecks
- Diagnosing disk bottlenecks
Skill Level Advanced
Learning Linux Shell Scripting (2017)with Sarath Lakshman8h 19m Intermediate
1. Performance Overview
2. CPU Bottlenecks
3. Memory Bottlenecks
4. Disk Bottlenecks
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.