差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
public:it:misc [2016/09/14 11:55] – oakfire | public:it:misc [2021/09/09 14:23] (当前版本) – oakfire | ||
---|---|---|---|
行 1: | 行 1: | ||
====== 杂项 ====== | ====== 杂项 ====== | ||
- | ===== 离线文档工具 ===== | ||
- | * [[https:// | ||
- | * [[https:// | ||
- | ===== Generate RSA key ===== | ||
- | <code bash> | ||
- | # 生成 RSA 私钥(传统格式的) | ||
- | openssl genrsa -out rsa_private_key.pem 1024 | ||
- | |||
- | # 生成 RSA 公钥 | ||
- | openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem | ||
- | |||
- | # 将传统格式的私钥转换成 PKCS#8 格式的 | ||
- | openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt | ||
- | </ | ||
===== Latency Numbers Every Programmer Should Know ===== | ===== Latency Numbers Every Programmer Should Know ===== | ||
- | <file text latency.txt> | + | * [[https:// |
- | Latency Comparison Numbers | + | Latency Comparison Numbers |
- | -------------------------- | + | ---------------------------------- |
- | L1 cache reference | + | L1 cache reference |
- | Branch mispredict | + | Branch mispredict |
- | L2 cache reference | + | L2 cache reference |
- | Mutex lock/ | + | Mutex lock/ |
- | Main memory reference | + | Main memory reference |
- | Compress 1K bytes with Zippy 3,000 ns | + | Compress 1K bytes with Zippy 2,000 |
- | Send 1K bytes over 1 Gbps network | + | Send 2,000 bytes over commodity |
- | Read 4K randomly from SSD* 150,000 ns 0.15 ms | + | SSD random read 16,000 |
- | Read 1 MB sequentially from memory | + | Read 1 MB sequentially from memory |
- | Round trip within same datacenter | + | Round trip within same datacenter |
- | Read 1 MB sequentially from SSD* 1,000,000 ns 1 ms 4X memory | + | Read 1 MB sequentially from SSD* 49,000 |
- | Disk seek 10, | + | Disk seek 2, |
- | Read 1 MB sequentially from disk 20,000,000 ns | + | Read 1 MB sequentially from disk 825,000 ns 825 us 1 ms |
- | Send packet CA-> | + | Send packet CA-> |
Notes | Notes | ||
----- | ----- | ||
- | 1 ns = 10-9 seconds | + | 1 ns = 10^-9 seconds |
- | 1 second | + | 1 us = 10^-6 seconds = 1,000 ns |
- | 1 ms = 10-3 seconds | + | 1 ms = 10^-3 seconds |
- | 1 second | + | </ |
- | * Assuming | + | |
- | + | | |
+ | Latency Comparison Numbers (~2012) | ||
+ | ---------------------------------- | ||
+ | L1 cache reference | ||
+ | Branch mispredict | ||
+ | L2 cache reference | ||
+ | Mutex lock/ | ||
+ | Main memory reference | ||
+ | Compress 1K bytes with Zippy | ||
+ | Send 1K bytes over 1 Gbps network | ||
+ | Read 4K randomly from SSD* | ||
+ | Read 1 MB sequentially from memory | ||
+ | Round trip within same datacenter | ||
+ | Read 1 MB sequentially from SSD* | ||
+ | Disk seek | ||
+ | Read 1 MB sequentially from disk 20, | ||
+ | Send packet CA-> | ||
+ | |||
+ | Notes | ||
+ | ----- | ||
+ | 1 ns = 10^-9 seconds | ||
+ | 1 us = 10^-6 seconds = 1,000 ns | ||
+ | 1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns | ||
Credit | Credit | ||
------ | ------ | ||
- | By Jeff Dean: http:// | + | By Jeff Dean: |
Originally by Peter Norvig: http:// | Originally by Peter Norvig: http:// | ||
- | + | ||
Contributions | Contributions | ||
------------- | ------------- | ||
- | Some updates from: https:// | + | 'Humanized' comparison: |
- | Great 'humanized' comparison | + | |
Visual comparison chart: http:// | Visual comparison chart: http:// | ||
- | Nice animated presentation of the data: http:// | ||
</ | </ | ||