Skip to content

Instantly share code, notes, and snippets.

@jihoonson
jihoonson / latency.txt
Created July 11, 2022 20:22 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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
@jihoonson
jihoonson / gist:ed9fcc56779e61f6954644640c2c22ef
Created February 13, 2019 20:46 — forked from asabaylus/gist:3071099
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@jihoonson
jihoonson / example-build.md
Created August 21, 2018 21:49
example-build.md
layout
doc_page

Build from Source

You can build Druid directly from source. Please note that these instructions are for building the latest stable of Druid. For building the latest code in master, follow the instructions here.

#!/bin/bash -eux
#
# Backports patches from master to a release branch.
#
# Usage:
# export GIT_TOKEN=...
# druid-backport [branch] [pr-number], like: "druid-backport 0.12.1 5706"
#
# Bugs:
@jihoonson
jihoonson / gb.md
Last active October 13, 2017 07:33
layout
doc_page

groupBy Queries

These types of queries take a groupBy query object and return an array of JSON objects where each object represents a grouping asked for by the query.

Note: If you are doing aggregations with time as your only grouping, or an ordered groupBy over a single dimension,
{
"queryType": "groupBy",
"dataSource": "tpch_lineitem_1g",
"granularity": {
"period": "P1D",
"timeZone": "CET",
"type": "period"
},
"aggregations": [
{ "type": "count", "name": "countSum", "fieldName": "count" }
{
"type" : "index_hadoop",
"spec" : {
"ioConfig" : {
"type" : "hadoop",
"inputSpec" : {
"type" : "static",
"paths" : "/tpch/1g/lineitem/lineitem.tbl"
}
},