Join Simon Allardice for an in-depth discussion in this video Speed expectations, part of Programming Foundations: Code Efficiency.
So you have an application that's running and…it needs the data in a one megabyte file.…This might be an image, it might be a document, whatever.…So, here's the difference between that file being either loaded in…memory, in the computer's RAM, or sitting on the hard drive.…So, if it's in RAM, well it will take about 100 nanoseconds…for the CPU to reference or get to a specific area of memory.…A nanosecond is a billionth…of a second.…And then to read one megabyte sequentially directly from…memory is very approximately, somewhere between 20,000 and 100,000 nanoseconds.…
Now, that might sound like a lot but if something takes…100,000 nanoseconds, you could repeat that 10,000 times in one second.…But if this one megabyte file is on the hard drive, well it's going…to take four to 10,000,000 nanoseconds just…to physically get to the right spot on…the drive. That's your hard drive seek time.…About four to ten milliseconds.…And that's about 100,000 times longer than getting…to the right spot in RAM, and it's going…
Learn to choose the right data types, understand the pitfalls of using high-level languages, and decide where to spend your time. Plus, see how the underlying memory management model may have more of an impact than you realize, and what performance issues you can expect working with databases and web services.
- Identifying problems in the code
- Embracing constraints
- Using code analysis tools to measure performance
- Managing memory
- Managing disk-based and network resources
Skill Level Beginner
Programming Foundations: Refactoring Codewith Simon Allardice1h 44m Intermediate
1. Approaching Efficiency
4. Algorithmic Efficiency
5. Disk-Based and Network Resources
Next steps6m 4s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.