Join Simon Allardice for an in-depth discussion in this video Introduction to Big O complexity, part of Foundations of Programming: Code Efficiency.
Imagine this, you just joined a new development project…and you find yourself working with some existing code.…As you look through the code you find two methods, SortV1 and SortV2.…And you see that both of these methods take the same input.…An array of unsorted integers and they just return that array sorted low to high.…And someone says, oh yeah, one of these is faster than…the other, but we can't remember which one, go and find out.…So you need to test them.…But how?…Well, first you assume, quite rightly, that one small test may not be accurate…enough, so you decide to do a repeated test to get a good average.…
So, first you'd create an array of 100 random numbers.…And then, and I'm just using pseudo-code here, we'll loop 1,000…times and we'll call SortV1, and then log the time it took.…And then we'll loop 1,000 times calling SortV2 and we'll log the time it took.…So you do this test and you find, they're pretty close.…Maybe within a few percent of each other. And this is a perfectly legitimate test.…
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.