Computer design: Difference between revisions
mNo edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=87e6e835-22fc-4eb8-b5df-af27012554f9 Computer architecture and design]<br> | Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=87e6e835-22fc-4eb8-b5df-af27012554f9 Computer architecture and design]<br> | ||
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=1171f7c8-74ea-43be-aff5-af2701250c46 Python IO performance & file buffers]<br> | Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=1171f7c8-74ea-43be-aff5-af2701250c46 Python IO performance & file buffers]<br> | ||
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22112/22112_04- | Powerpoint: [https://teaching.healthtech.dtu.dk/material/22112/22112_04-Computers.ppt Computer design]<br> | ||
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=ed903123-66d6-4dd8-ac09-af1700719d93 Exercises] | Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=ed903123-66d6-4dd8-ac09-af1700719d93 Exercises] | ||
Note that the videos are no longer completely aligned with the powerpoints due to a shift in focus. | |||
<!-- | <!-- |
Latest revision as of 23:00, 6 August 2025
Previous: Coding against databases | Next: Queueing System |
Material for the lesson
Video: Computer architecture and design
Video: Python IO performance & file buffers
Powerpoint: Computer design
Video: Exercises
Note that the videos are no longer completely aligned with the powerpoints due to a shift in focus.
Exercises
Create four python scripts which copies the file human.fsa to your own home, using the four different methods mentioned in the powerpoint. Time the programs using ’time’, e.g.
time python mycopy1.py
Also time the simple Unix cp doing the same task. Delete your copy afterwards.
Rank the programs according to performance and explain the difference in execution time.
This is actually a bit hard to do correctly. Considering what you learned about file buffering, then reading the same file twice (or more) in a row will use the file buffers instead of real IO the second time. This means that the first time is always slowest, no matter how efficient the different programs are. You can't even be sure if another student is reading the same file at the same time and hence "disturbs" your measurements.
A way around this problem is simply to use a computer with so little memory, that the file buffer system does not come into play. That is your laptop.
Try to run the scripts on different machines. As minimum you have your laptop and pupil1. DTU's HPC system is also an option.