Practice: Memory
Contents
Practice: Memory#
Question 0#
Rank the different types of memory from the slowest to fastest. This means the slowest memory should be on the top and the fastest on the bottom.
Your Task
Reorder the following options. Write your answer down in your own space.
Option 0
Cache
Option 1
Disk
Option 2
Main Memory (RAM)
Option 3
Register
Question 1#
When creating objects in Python, what section of main memory (RAM) are they most likely to be created in?
Your Task
Select one option. Write your answer down in your own space.
Option 0
Cache
Option 1
Disk
Option 2
Heap
Option 3
Instructions
Option 4
Register
Option 5
Stack
Question 2#
Select all that apply .
Your friend is working on a data analysis project and notices their program is running very slowly for their very large dataset (say 20 GBs large). What might you recommend as good strategies to help them develop their program?
Your Task
Select one or more options. Write your answer down in your own space.
Option 0
Change their data processing to access all of the data in a random order rather than using a loop that goes from start to end.
Option 1
While developing their code to see if itβs correct, work with a smaller version of the data just to make sure the code can run to completion without error before running it on the whole dataset.
Option 2
If their analysis is able to finish running, save the results using pickle
so they can avoid doing the analysis again to recreate their results.
Option 3
Look on the internet to see if you can write special code to force Python to store the entire 20GB dataset in a register.