It is currently Mon Aug 20, 2018 7:40 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue May 08, 2018 11:35 am 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 337
The built-in prefetcher tends to be pretty good though. PREFETCH makes code slower in many cases.

Espozo wrote:
I don't know how it would do this for a single intensive program that wants to use the system's full resource; I wouldn't think you could just generically divide up the load, not only because how would you even divide it in the first place, but because obviously programs are going to assume things are going to be processed linearly.

It's stupidly hard. See: concurrent programming. The billion dollar question is how to generically parallelize things.


Top
 Profile  
 
PostPosted: Tue May 08, 2018 12:20 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6607
Location: Canada
pubby wrote:
The built-in prefetcher tends to be pretty good though. PREFETCH makes code slower in many cases.

Built in prefetching works well for some access patterns (esp. serial/linear access), and in a similar way you can often improve performance by reorganizing how your data is stored, which doesn't in itself require manual cache control, and is probably a better first approach to cache optimization if your data structures are still malleable.

A misused manual prefetch absolutely does make code slower, but IMO if you're effectively using manual cache control you should already measuring its effect to make sure, so you shouldn't fall into this trap unless you're using it blindly.

For instruction prefetching, the automated version tends to work quite well (the main mitigating factor here is branch prediction), since code mostly runs linearly anyway. I've never actually seen manually prefetched code, only data, though I'm sure there's a use case out there somewhere.


Top
 Profile  
 
PostPosted: Wed May 09, 2018 3:30 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2732
I remember the late 90's, early 2000's computers where speed was VERY unpredictable. Every time there was slightly too much going on, the computer would go from 60 fps to 5 fps. I'm guessing it's a combination of cache misses, and hard-drive reading/writing.


Top
 Profile  
 
PostPosted: Wed May 09, 2018 3:57 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6607
Location: Canada
When you're multitasking, if two programs you're running need to share more RAM than you have available, when the OS switches between them it will temporarily copy RAM to the hard drive to make room. Or even if one program requests too much RAM (web browsers are notorious memory hogs) it may page some of it to the hard disk.

I think the larger availability of RAM has made a huge difference for this, which is not the only cause of unpredictable performance loss but it was definitely a major one. You might also consider this a caching issue, as the physical RAM is essentially a faster cache for the larger virtual RAM space including the hard drive.


Top
 Profile  
 
PostPosted: Wed May 09, 2018 5:57 pm 
Offline

Joined: Sun Mar 27, 2011 10:49 am
Posts: 259
Location: Seattle
A couple of other technology improvements that have helped: SSDs mean the difference between disk and memory access is no longer quite so dramatic; multicore processors mean that other processes are less likely to steal your compute time out from underneath you.


Top
 Profile  
 
PostPosted: Wed May 09, 2018 6:57 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6607
Location: Canada
Oh yeah, and there's also hybrid SSDs where you have a smaller SSD operating on top of a larger traditional hard drive, again a form of cache. Actually hard drives generally have varying types of cache devices, all of it internal and transparent to the interface, usually. Also helps with durability, e.g. you can hold data in the cache if sudden movement is detected to try and prevent a crash.


Top
 Profile  
 
PostPosted: Wed May 09, 2018 7:08 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6607
Location: Canada
rainwarrior wrote:
Cache is a more generic term, it's not memory-specific. A cache optimization stores some result and reuses it, instead of having to do it the "long" way. That long way could refer to a slow main memory fetch, or it could be some kind of computation, etc.

For some more reference on this: Memoization is a term that describes the technique of result caching, and strongly correlated with this is Dynamic Programming which is a large family of algorithms that can be made very efficient by caching results progressively.


Top
 Profile  
 
PostPosted: Wed May 09, 2018 7:34 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3488
Location: Mountain View, CA
adam_smasher wrote:
A couple of other technology improvements that have helped: SSDs mean the difference between disk and memory access is no longer quite so dramatic; multicore processors mean that other processes are less likely to steal your compute time out from underneath you.

Yes, all true, except no longer is CPU load what we expect (and here's a 5 minute presentation of the same content from the same author). Thanks, Meltdown/Spectre!


Top
 Profile  
 
PostPosted: Wed May 09, 2018 8:09 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 960
adam_smasher wrote:
multicore processors mean that other processes are less likely to steal your compute time out from underneath you.

Even core multithreading by itself helps. Without it, multitasking had a lot of overhead on a single-core CPU because the OS could only run one thread at a time, and every time it switched tasks the CPU had to get rid of what it was doing and start from scratch on the new thread. This meant that a single high-priority process could basically stall the whole machine. When I got a Pentium 4 Prescott (single-core hyperthreading) in 2004, I stopped having this problem - Matlab could get stuck in a tight loop and forget to listen to the command line just like before, but Windows still worked fine around it. I could run Emulator X and DOSBox (both CPU hogs) in parallel without hiccups, to get realistic orchestra music out of TIE Fighter. It was pretty neat for the time, I thought... at least during winter, with an aftermarket cooler...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group