Join Todd McLeod for an in-depth discussion in this video Optimizing our code with concurrency, part of Code Clinic: Go.
- So the next thing we're going to do is…we're going to add concurrency into our solution.…And concurrency is going to allow us to…take advantage of all the processors,…all the CPUs on our machine.…So that will help our code run faster.…And we're going to try to see if…we can get our code to run faster.…So the very first thing I did was…I wanted to put a time function in.…Once again just to time how long does this take?…And I'm doing it slightly different here.…I'm using time.Since(start) and giving…me the seconds back on that.…Before, you'll remember, we did…this method right here, where in…godoc.org, Standard Library Package, time,…we did sub.…
And this time we are using Since.…So I'm going to measure how long did the code take to run?…And if I come over here and I run that,…right here in 12,…we'll see how long it takes.…Now you'll notice that that took 18.38 seconds.…But let's take a look at what we can…do to improve that performance.…So the next thing I did in cleaning up my code,…is I did a little bit of abstraction.…
Todd introduces challenges and then provides overviews of his solutions in Go. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Skill Level Beginner
1. Problem 1—Exploring Lake Pend Oreille
2. Problem 2—Image Analysis
3. Problem 3—Eight Queens
4. Problem 4—Accessing Peripherals
5. Problem 5—Recursion and Directories
6. Problem 6—Building the Web
- 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.