Skip to content

Instantly share code, notes, and snippets.

View junhuihuang's full-sized avatar

junhui huang junhuihuang

View GitHub Profile
@junhuihuang
junhuihuang / auto-save.el
Created June 21, 2018 01:59
ManateeLazyCat auto-save.el
;; defgroup 关键字的意思是定义一个工作组,执行 Alt + x customize-group 命令的时候可以进行图形化的模块配置
;; 第一个参数是模块的名字, 比如 auto-save
;; 第二个参数是模块默认开启的状态, 在 elisp 中, t 表示 true, nil 表示 false
;; 第三个参数是对模块的文本解释
;; 第四个参数表示对外提供 auto-save 这个 group
(defgroup auto-save nil
"Auto save file when emacs idle."
:group 'auto-save)
;; defcustom 关键字的意思是定义一个可以被用户自定义的变量, 当用户执行 Alt + x customize-variable 的时候就可以补全 auto-save-idle 这个变量, defcustom 和 defvar 的区别主要是 defcustom 用于提供一些参数让用户可以在 Emacs 中图形化定制变量内容, defvar 这只有变量名和 List 内容, 一般用于函数内部变量值存储用, 不对外抛出给用户定制
@junhuihuang
junhuihuang / latency.txt
Created September 6, 2017 06:06 — 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