What is CPU Cache?
Techquickie
·Techquickie
·2017-05-06
·
921 words · ~4 min read
0:00
When you think of memory in your computer, you might think of things like DDR modules, VRAM on your graphics card,
0:05
or most likely just hard drives and SSDs. But there's actually another type
0:10
of memory that's incredibly fast and
0:13
essential to the speed that we've gotten accustomed to with modern computers. I'm
0:18
talking about your CPU cache. No, not
0:21
the money that you blew on that processor with hyperthreading that you
0:25
didn't really need. What we're talking about is cache with an E. It's a
0:30
specialized type of memory that's built into your CPU. But why the heck would
0:35
your processor need its own memory? Aren't the 16 gigs of RAM or whatever
0:39
the heck you already have in your computer good enough? Well, not really,
0:44
to be honest. You see, those RAM modules are a heck of a lot faster than say a
0:49
hard drive in terms of data transfer. Like a lot faster. But your CPU actually
0:53
wants data much faster than your RAM can even provide it. And on top of that, as
0:58
CPUs have gotten faster over the years, they continue to outstrip typical RAM
1:02
modules by wider and wider margins. Meaning that without faster memory, your
1:08
CPU is going to be sitting around doing nothing like a kind of unproductive
1:12
employee as it waits for RAM and you'll run into bottlenecks as a result. This
1:17
is where cache comes in. Unlike system memory, which consists of dynamic RAM or
1:22
DRAM, your CPU cache is static RAM or
1:25
SRAMM, which is more expensive and takes up more space, but is much faster than
1:30
DRAM because it doesn't have to be constantly refreshed in order to hold
1:35
data the way that DRAM has to be. An average CPU will only have a few
1:39
megabytes of cache, but it makes a tremendous use of this small amount of
1:43
memory. You see, when a CPU accesses something from your main system RAM, it
1:48
generally stores it in its cache, then uses complex algorithms to guess as to
1:54
what other instructions or data it might need next. And it fetches those from
1:58
your system RAM as well. Since these guesses aren't perfect, CPUs suffer from
2:03
things called cache misses, where it searches its own cache, can't find what
2:08
it needs, and has to access your system memory directly instead, which slows
2:13
things down. Fortunately, however, modern processors have gotten pretty
2:16
good at deciding what to put inside their caches, as they'll typically have
2:21
a cache hit rate of better than 80%.
2:24
Meaning that most of the time, your CPU is only processing what it finds in
2:29
cache and doesn't have to bother talking to your slower system memory at all. And
2:34
as you may have guessed, more cache is advantageous. So, when you're shopping
2:38
for a processor, the product page will indicate how much level three or L3
2:43
cache is built in with higherend modules
2:46
having a few extra megabytes. And if you're wondering what the heck happened
2:50
to levels one and two, these are smaller, even faster parts of the cache
2:56
that your CPU will try and hit before looking for data in your level three
3:00
cache. Okay, Luke, that's cool and all, but will better cache actually give me
3:05
more FPS in games or faster speeds in my
3:09
other stuff? Well, this can depend on the specific application, but you can
3:13
see performance increases kind of overall on CPUs with larger caches.
3:18
Fortunately, though, if you're buying a higherend processor because you need
3:22
more cores, higher IPCs, or better overclocking potential in general, it'll
3:27
probably come with more cash as well. So, it's not really something that you
3:31
have to really think about too much. Of
3:34
course, if you really want that high-end silicon, make sure that you're paying
3:38
attention to how much cash with an S that your wallet has left. Are you
3:43
trying to program payments into your app and it's just not that easy? If you're
3:47
building a mobile app and searching for a simple payment solution, check out
3:50
Brainree. Brainree's V.0 SDK is one
3:53
amazingly simple integration away from giving you simple payments every time.
3:58
Developers around the world have embraced the Brainree V.0 SDK as the
4:02
easiest way to add secure mobile payments to their apps and websites.
4:06
Once integrated, Brainree supports a bunch of different ways to pay like
4:09
Apple Pay, Android Pay, PayPal, Venmo, credit cards, and even Bitcoin. And if
4:14
something new pops up, Brainree will support that, too. It's used by Uber,
4:18
Airbnb, GitHub. It's scalable. It integrates into your app easily. Just a
4:22
few lines of code. Try it in the sandbox. Learn more about Brainree in
4:26
the video description down below. and get your first 50,000 in transactions
4:31
fee free at
4:34
brainttreeepayments.com/techquicky. But are you cashed out? If you are, be sure
4:37
to like the video, dislike the video, subscribe, do all those fun things. And
4:40
on your way out the door, be sure to check out channel Superfund right across
4:44
the street. They're fantastic. Highly recommended. And as always, leave a
4:49
comment on the little book as you as you leave with the suggestions that you
4:52
might have for how we could make your stay even more better next time. And
4:57
anyways, thank you for enjoying Techquiki. We'll see you again.