Skip to content

Instantly share code, notes, and snippets.


Jiacai Liu jiacai2050

View GitHub Profile
jiacai2050 /
Created Feb 24, 2021 — forked from coolaj86/
What we call programmers - because labels make us happy!
jiacai2050 / latency.txt
Created Jan 10, 2021 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
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
trait Engine {
fn eval(&self) -> String;
struct JSEngine {
name: String,
impl JSEngine {
fn new(name: String) -> Self {
View .blogbackup.edn
{:description "Blog-backup config"
:home-page ""
:blogs [{:id "go-blog"
:base-url ""
:posts-selector "div#content > p > a"
:page-tmpl "{{base-url}}"
:total-page 1}
{:id "meituan"
:base-url ""
:posts-selector " > h2 > a"
View core_async_expand.cljs
;; (macroexpand '(go (<p! (.launch puppeteer pp-opts))))
[c__25860__auto__ (cljs.core.async/chan 1)]
jiacai2050 / output.txt
Created Apr 18, 2020
Example to reproduce stackoverflow error
View output.txt
thread '
thread 'outer-thread-0' has overflowed its stack
fatal runtime error: stack overflow
outer-thread-1' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)
jiacai2050 / bench_test.go
Created Mar 15, 2020
go value vs pointer benchmark
View bench_test.go
package main
import "testing"
var blackholeStr = ""
var blackholeValue student
var blackholePointer *student
func BenchmarkPointerVSStruct(b *testing.B) {
jiacai2050 / web.go
Last active Aug 25, 2020
A simple web app demonstrate how to deal with err in handler
View web.go
package main
import (
jiacai2050 / Dockerfile
Created Jan 9, 2020
custom prometheus docker file
View Dockerfile
FROM prom/prometheus:v2.12.0
COPY ./ /
CMD []