Skip to content

Instantly share code, notes, and snippets.

View tkrs's full-sized avatar
🤯
I may be slow to respond.

Takeru Sato tkrs

🤯
I may be slow to respond.
  • Gunma, Japan
  • 23:39 (UTC +09:00)
View GitHub Profile
@tkrs
tkrs / Main.scala
Last active September 17, 2021 21:51
Shapeless automatically derives BigQuery TableSchema from case class
import com.google.api.services.bigquery.model.TableFieldSchema
import com.google.api.services.bigquery.model.TableSchema
import org.joda.time.Instant
import shapeless._
import shapeless.ops.hlist.FillWith
import shapeless.ops.hlist.Mapper
import shapeless.ops.hlist.ToList
import shapeless.ops.record.Keys
import shapeless.ops.record.Values
@tkrs
tkrs / bigtable.sc
Last active January 3, 2021 19:50
Bigtable CLI
import $ivy.`com.github.tkrs::orcus-bigtable:0.25.2`
import $ivy.`com.github.tkrs::orcus-cats-effect:0.25.2`
import $ivy.`com.github.tkrs::mess-core:0.2.4`
import $ivy.`com.github.scopt::scopt:4.0.0`
import java.time.Instant
import cats.effect.IO
import cats.instances.map._
import cats.syntax.all._
@tkrs
tkrs / main.go
Created April 15, 2019 08:38
go gcsql
package main
import (
"database/sql"
"database/sql/driver"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
[
{
"jmhVersion" : "1.21",
"benchmark" : "mess.bench.PackBench.encodeLong10",
"mode" : "thrpt",
"threads" : 1,
"forks" : 2,
"jvm" : "/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/bin/java",
"jvmArgs" : [
"-server",
@tkrs
tkrs / benchmark.log
Created July 20, 2018 03:59
orcus benchmark running on 1fc40f23aae7f351dc1b533c47089e7c9e009c59, GCP n1-highcpu-8
> sbt "benchmark/jmh:run -p threads=8,16,32 -t 8 -prof gc -rf json"
[info] Benchmark (size) (threads) Mode Cnt Score Error Units
[info] o.async.benchmark.ArrowsTwitterAsyncHandler.bench N/A 8 thrpt 20 20309.348 ± 1636.720 ops/s
[info] o.async.benchmark.ArrowsTwitterAsyncHandler.bench:·gc.alloc.rate N/A 8 thrpt 20 1118.660 ± 177.257 MB/sec
[info] o.async.benchmark.ArrowsTwitterAsyncHandler.bench:·gc.alloc.rate.norm N/A 8 thrpt 20 63807.306 ± 9571.187 B/op
[info] o.async.benchmark.ArrowsTwitterAsyncHandler.bench:·gc.churn.PS_Eden_Space N/A 8 thrpt 20 1194.851 ± 112.504 MB/sec
[info] o.async.benchmark.ArrowsTwitterAsyncHandler.bench:·gc.churn.PS_Eden_Space.norm
@tkrs
tkrs / jmh-result-fluflu-msgpack-circe.json
Last active June 19, 2018 11:17
fluflu-msgpack-circe vs mess
[
{
"jmhVersion" : "1.21",
"benchmark" : "PackBench.encodeLong10",
"mode" : "thrpt",
"threads" : 1,
"forks" : 2,
"jvm" : "/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/bin/java",
"jvmArgs" : [
],
[
{
"jmhVersion" : "1.21",
"benchmark" : "fluflu.msgpack.AstBench.encodeLong10Circe",
"mode" : "thrpt",
"threads" : 1,
"forks" : 2,
"jvm" : "/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/bin/java",
"jvmArgs" : [
"-XX:+UseG1GC",
@tkrs
tkrs / msgpack-bench-cache.json
Last active May 22, 2018 15:24
Massage Pack (De)Serializer comparison
[
{
"jmhVersion" : "1.21",
"benchmark" : "fluflu.msgpack.Bench.encodeLong10Circe",
"mode" : "thrpt",
"threads" : 1,
"forks" : 2,
"jvm" : "/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/bin/java",
"jvmArgs" : [
"-XX:+UseG1GC",
@tkrs
tkrs / json-bench-jmh-result.json
Last active May 17, 2018 04:31
JMH Result JSON format
[
{
"jmhVersion" : "1.21",
"benchmark" : "bench.Case1.decodeArgonaut",
"mode" : "thrpt",
"threads" : 1,
"forks" : 2,
"jvm" : "/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/bin/java",
"jvmArgs" : [
"-XX:+UseG1GC",
@tkrs
tkrs / post.go
Created April 25, 2018 04:21
Print the HTTP response in Go
package main
import (
"bytes"
"compress/gzip"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"