Skip to content

Instantly share code, notes, and snippets.

View TheIllusionistMirage's full-sized avatar
💭
Who shall guard the guards?

Koushtav Chakrabarty TheIllusionistMirage

💭
Who shall guard the guards?
View GitHub Profile
@TheIllusionistMirage
TheIllusionistMirage / latency.txt
Created January 27, 2018 15:30 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
/**
* More info?
* a.dotreppe@aspyct.org
* http://aspyct.org
* @aspyct (twitter)
*
* Hope it helps :)
*/
#include <stdio.h>
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}
#While this particular version takes files of the text on my followers and following pages,
#it can be easily modified to check a past list of followers against a more recent list -
#just replace following.txt with the "past followers" file and followers.txt with "present followers".
#encoding may be 'utf-8' depending on the type of files you are using
with open('following.txt', 'r', encoding = 'latin-1') as following_file:
with open('followers.txt', 'r', encoding = 'latin-1') as followers_file:
discrepancy = set(following_file).difference(followers_file)