Showing posts with label interesting. Show all posts
Showing posts with label interesting. Show all posts

Saturday, August 23, 2014

Memory access latencies

Once, I saw a table in which all the memory latencies are scaled in such a way that CPU cycle is defined to be 1 second, and then L1 cache latency is several seconds, L2 cache even more, and so on up to SCSI commands timeout and system reboot. This was very interesting because I have much better developed sense for seconds and higher time units that for nanoseconds, microseconds, etc. Few days ago I remembered that table and I wanted to see it again, but couldn't find it.  This was from some book I couldn't remember the name. So, I started to google for it, and finally, after an hour or so of googling, I managed to find this picture. It turns out that this was from the book Systems performance written by Brendan Gregg. So, I decided to replicate it here for a future reference:


Table 2.2: Example Time Scale of System Latencies
Event Latency Scaled
1 CPU Cycle 0.3 ns 1 s
Level 1 cache access 0.9 ns 3 s
Level 2 cache access 2.8 ns 9 s
Level 3 cache access 12.9 ns 43 s
Main memory access (DRAM, from CPU) 120 ns 6 min
Solid-state disk I/O (flash memory) 50 - 150 us 2-6 days
Rotational disk I/O 1-10 ms 1-12 months
Internet: San Francisco to New York 40 ms 4 years
Internet: San Francisco to United Kingdom 81 ms 8 years
Internet: San Francisco to Australia 183 ms 19 years
TCP packet retransmit 1-3 s 105-317 years
OS virtualization system reboot 4 s 423 years
SCSI command timeout 30 s 3 millennia
Hardware (HW) virtualization system reboot 40 s 4 millennia
Physical system reboot 5 min 32 millennia

It's actually impressive how fast CPU is with respect to other components. It is also very good argument for multitasking, i.e. assigning CPU to some other task while waiting for, e.g. disk, or something from the network.

One additional impressive thing is written below the table in the book. Namely, if you multiply CPU cycle with speed of light (c) you can see that the light can travel only 0.5m while CPU does one instruction. That's really impressive. :)

That's it for this post. For the end, while I was searching for this table, I stumbled on some additional interesting links:



Sunday, February 26, 2012

Computer units sold...

I stumbled on the following article that has a graphic about different computer units sold per year from 1975 until 2011. I reproduced it here for a completeness:


It's obvious that by "computer units" is meant both personal computers and mobile phones. Anyway, this graphic is very interesting even though many popular units are missing, e.g. Spectrum, Amstrad, Commodore 128, some Atari models. This graph was taken from Asymco.

What this make me wonder is if there is some page with this data in one place, so that curious person can play a bit with that data. Quick googling didn't reveal much. I tried expressions like c64 units sold, or home computer units sold per year.  Still, I found some quite interesting pages. I'll list them here, and if it happens that you know where I can find all the data I was looking for, please do tell me! The most interesting, and relevant, page I found is an article on Wikipedia about Console wars in which some data can be found. This page also has a plenty of references, which I didn't pursue further. Also, while googling, this page frequently appeared. The interesting thing in that particular article is how they estimate number of C64 units sold per year using serial numbers! The method used is actually much older, it dates back to WWII when Allies used it to estimate number of tanks German army produced. Serial numbers of C64 computers were obtained from the Web site that collects C64 serial numbers. Using this method and data the article estimates that there were 12.5 million units of C64 produced.

All in all, very interesting stuff, but it seems that it would require much more time than I devoted to it, and that I'm ready to devote to it. :)

Saturday, January 28, 2012

Usefull Unix commands, tips and tricks...

Have you seen this question on Hacker News? It's great and actually there are really some useful commands and tips for use of the command line more efficiently. Here I'll list some of them in case you want a quick glance, but be aware that something mentioned there might already be known to me and/or I decided that it's not so important and excluded it.

So, without further ado, here's my list of favorites:

Saturday, November 19, 2011

Interesting fact about card shuffling...

Every now and then it happens to me that I stumble upon something obvious yet something that didn't occurred to me. This time it was this post. It's about shuffling cards, I and many others did it so many times. Yes, I knew that there are many combinations, but with a little bit of analysis it turns out that there are so many combinations that every shuffle is very likely unique in a history of card shuffling. That conclusion is what made my say Wow! Even more impressive is when you say that particular ordering of cards is uniqe in human history. Admittedly, that is a bit out of proportions since modern cards, accoring to the post, appeared in Europe somewhere around 14th century And, according to Wikipedia, they were invented in China, somewhere in 9th century. But even if the cards were with humans from the day one (however we interpret that), it wouldn't be enough time to try all the combinations!

The total number of combinations with a deck of 52 cards is 52!. This is exactly:
52! = 80658175170943878571660636856403766975289505440883277824000000000000
or approximately 8.0658X1067. It is a huge number, even though substantially less than number of atoms in visible universe (1080) :). Ok, and with overestimation of number of shuffles done in history of playing cards we end up with a number that is by 40 orders of mangitude smaller, i.e. somewhere around 1.546X1020 (note that I think that in the original post there is an error in the calculation).

And for the end I have an interesting rhetoric question: Can I patent a certain card combination as an invention? :) Obviously, I can not give decisive proof that no one else invented that particular combination, but this shows that it is highly likely so! :)

Saturday, September 10, 2011

Nastanak novca i dug...

Danas sam naletio na jedn zanimljiv intervju. Mislio sam da se radi o razjašnjavanju pojma duga države o kojemu se stalno priča, ali je na kraju ispalo da se radi o nečemu širemu, a uključuje između ostalog i pitanje kako je nastao novac.

U školi su nas učili kako je prvotni način trgovanja bila trampa te da je novac izmišljen kao posljedica neadekvatnosti trampe (Imaš kravu i trebaš moje piliće, ali meni krava ne treba. :)). Tek nakon što je izmišljen novac, dolazi do pojave posudbe i kreditiranja. Ta hipoteza o nastanku novca vuče se barem od Adama Smitha i njegovog rada Bogatstvo naroda.

Međutim, na stranici koju sam spomenuo na početku nalazi se intervju s Davidom Graeberom. Preporučio bih da ipak pogledate ukratko što Wikipedija kaže o njemu budući da mi se čini kako njegovi opći stavovi dosta utječu i na njegovo razmišljanje, ili obratno - svejedno. U tom intervjuu on tvrdi kako je to u stvari obrnut redoslijed, tj. prvo je nastala posudba i kreditiranje, potom novac, a kada bi se skršio monetarni sustav onda bi se pribjegavalo trampi. Kada ovako, kao laik, malo razmislim o tome, čini mi se vrlo logično. Na kraju krajeva, u Hrvatskoj su vrlo popularne kompenzacije ovih godina, a razlog za to je što financijski sustav baš ne funkcionira (opet, zaključujem to kao laik). No, čini mi se da je glavni problem kako bi se utvrdilo koja teza je točna u tome što se već u najstarijim pisanim zapisi koji sežu 3200 godina prije Nove ere i koji su nastali u Mezopotamiji nalaze tragovi novca i financijskog sustava. Prema tome, novac je nastao ranije i za to nema pisanih tragova.

U drugom dijelu intervjua naglasak je na trenutnoj dužničkoj situaciji u svijetu. Koliko god u Hrvatskoj mislili da se živi na kredit i da je to nečuveno, na zapadu izgleda nije ništa bolje, pogotovo u Americi. Jedna od stvari s kojom se slažem je da mi se čini sasvim prirodno da ljudi uvijek kukaju kako žive u najtežim vremenima, ali da je svako vrijeme teško na svoj način. Nadalje, po njemu, ciklusi dužničkih kriza su se stalno ponavljali, ali to su ciklusi koji traju po 500tinjak godina. No, u novije vrijeme ti ciklusi se skraćuju, a stare metode otpisivanja dugova se više ne mogu primijeniti iz različitih razloga.

Čitajući ovaj intervju saznao sam još podosta stvari, a to u stvari čini čitanje takvih tekstova isplativo. Prvo, za sociologa Marcela Maussa koji je napisao vrlo utjecajnu knjigu The Gift. Marcel Mauss u toj knjizi analizira što je moglo potaknuti razvoj novca ako to nije trampa te je po njegovoj tezi to bio poklon. Ako sam dobro shvatio, osnovna teza je da ako ja nekome poklonim nešto, onda taj netko se osjeća dužan meni vratiti. Naravno da to ne vrijedi za apsolutno svaku situaciju. Zanimljivost je i da se ta analiza proteže na otvoreni kod.

Zatim, tu su različite ekonomske teorije novca (commodity theory of money, monetary circuit theory, chartalist theory of money) i općenito problem teorije novca koji meni kao laiku izgleda nepostojeći, ali je stvaran i vrlo problematičan.

Za kraj, ima priličan broj komentara na kraju koje također treba pročitati kako bi se vidjela i druga strana (ako ju je tko iznio). Uglavnom, namjeravam to jednom...

About Me

scientist, consultant, security specialist, networking guy, system administrator, philosopher ;)

Blog Archive