Join Simon Allardice for an in-depth discussion in this video What to look for in code, part of Foundations of Programming: Code Efficiency.
I've placed such an emphasis on profiling in this course because it…is the best way to narrow your focus to a specific area.…But if we are now looking at some code, what should we be looking for?…While keeping this as generic as possible, I'll go through…the most common places you should be bringing your attention.…Iterations, collections, sorting, inserting, and string operations.…Now as with memory, the main reason you look…at iterations first is because the potential is so high.…Any improvement you can make inside…an iteration that runs 10,000 times is an improvement that run 10,000 times.…Now nested iterations, loops within loops is…certainly something that should draw your attention.…
Nested iterations by themselves aren't bad, and they're often totally necessary.…But be particularly aware of nesting where you're iterating over…the same data in both the inner and outer loop.…This is something that leads to order n squared complexity or sometimes worse.…And beware that nesting…is rarely as obvious as this.…
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
Foundations of Programming: 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?
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.