MISSION 169

I/O Bound Programs

In the last lesson, we covered CPU bounds, and showed how they can limit the performance of your program. We analyzed numerous algorithms, and figured out how they impact code performance.

In this lesson, you will get familiar with I/O bound tasks and take a look at some examples of I/O tasks. You will compare and contrast CPU bound tasks to I/O tasks. And of course, you will learn how to improve I/O performance! 

In this lesson, we’ll also talk about threading and thread locking, and how these important concepts relate to I/O performance. 

As we work through this lesson, we'll use a SQLite database of baseball statistics from Major League Baseball, or MLB, an American baseball league. The data originally came from Sean Lahman's site, and was transformed to a SQLite database. If you're unfamiliar with SQLite, we cover the basics of SQLite in our Using PostgreSQL mission.

As you work through understanding I/O performance, you’ll get to apply what you’ve learned from within your browser so that there's no need to use your own machine to do the exercises. The Python environment inside of this course includes answer checking so you can ensure that you've fully mastered each concept before learning the next.

Objectives

  • About I/O bounds and their impact on your code.
  • Learn to identify I/O problems by profiling your code.
  • Learn when to use parallel computing to improve runtime.

Mission Outline

1. I/O Bounds
2. Profiling an I/O bound task
3. Blocking Tasks
4. Parallel Execution
5. Thread Blocking
6. Joining Threads
7. Joining Threads
8. Locking
9. Locking
10. Thread Safety
11. Returning Values From Threads
12. Returning Values From Threads
13. Next Steps
14. Takeaways

improving-code-performance

Course Info:

Intermediate

The median completion time for this course is 4.7 hours. View Details

This course requires a premium subscription and includes four missions, and one guided project.  It is the fourth course in the Data Engineer path.

START LEARNING FREE

Take a Look Inside